c:nmp:using_open_api_example
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
c:nmp:using_open_api_example [2017/05/22 08:24] – hkimscil | c:nmp:using_open_api_example [2020/06/09 13:43] (current) – removed hkimscil | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 오픈 API ====== | ||
- | <WRAP box 450px> | ||
- | 혹은 공공데이터법 \\ | ||
- | - " | ||
- | - " | ||
- | - " | ||
- | - " | ||
- | </ | ||
- | |||
- | Key 승인: | ||
- | * 자동승인 혹은 | ||
- | * 심의승인 ([[http:// | ||
- | |||
- | ====== Sites and Services ====== | ||
- | Search, Portal | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | Film and movies | ||
- | |||
- | Public | ||
- | * [[https:// | ||
- | * [[https:// | ||
- | * [[https:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | |||
- | Abroad | ||
- | * Amazon: | ||
- | * [[https:// | ||
- | * [[https:// | ||
- | |||
- | ---- | ||
- | {{all_comb.xlsx}} | ||
- | < | ||
- | library(RCurl) | ||
- | library(rjson) | ||
- | library(twitteR) | ||
- | library(digest) | ||
- | library(ROAuth) | ||
- | library(KoNLP) | ||
- | library(rJava) | ||
- | library(tm) | ||
- | library(wordcloud) | ||
- | library(XLConnect) | ||
- | |||
- | setwd (" | ||
- | |||
- | rm(list=ls()) | ||
- | ani<- file.path(" | ||
- | |||
- | anisheet <- readWorksheetFromFile(ani, | ||
- | ani.text <- Corpus(VectorSource(anisheet$plotStory)) | ||
- | result.text <- ani.text | ||
- | |||
- | |||
- | myCorpus <- Corpus(VectorSource(result.text)) | ||
- | myCorpus <- tm_map(myCorpus, | ||
- | myCorpus <- tm_map(myCorpus, | ||
- | myCorpus <- tm_map(myCorpus, | ||
- | myStopwords <- c(stopwords(' | ||
- | myCorpus < | ||
- | |||
- | inspect(myCorpus[1: | ||
- | |||
- | myTdm <- TermDocumentMatrix(myCorpus, | ||
- | mat <- as.data.frame(as.matrix(myTdm)) | ||
- | write.table(mat, | ||
- | |||
- | pal <- brewer.pal(12," | ||
- | |||
- | # 폰트 세팅. 띄어쓰기나 대소문자에 민감하다는 점에 주의 | ||
- | # 맑은고딕 : windowsFonts(malgun=windowsFont(" | ||
- | # 나눔고딕 : windowsFonts(malgun=windowsFont(" | ||
- | windowsFonts(malgun=windowsFont(" | ||
- | |||
- | m <- as.matrix(myTdm) | ||
- | # calculate the frequency of words | ||
- | v <- sort(rowSums(m), | ||
- | myNames <- names(v) | ||
- | k <- which(names(v)==" | ||
- | myNames[k] <- " | ||
- | d <- data.frame(word=myNames, | ||
- | # | ||
- | wordcloud(d$word, | ||
- | </ | ||
- | |||
- | {{ani_plot.png}} | ||
- | |||
- | {{myTdm-ani.txt}} | ||
- | |||
- | < | ||
- | < | ||
- | <meta charset=" | ||
- | </ | ||
- | < | ||
- | |||
- | <?php | ||
- | |||
- | $txt=''; | ||
- | $myfile = fopen(" | ||
- | $lines = file(' | ||
- | $key = " | ||
- | |||
- | |||
- | for ($i=0; | ||
- | $q = $lines[$i]; | ||
- | $url = " | ||
- | |||
- | echo " | ||
- | echo "< | ||
- | $xml = simplexml_load_file($url); | ||
- | echo " | ||
- | |||
- | echo "< | ||
- | echo $xml-> | ||
- | echo "</ | ||
- | |||
- | |||
- | foreach ($xml-> | ||
- | $text = " \"" | ||
- | $text .= " \"" | ||
- | $text .= $oitemVal-> | ||
- | $text .= " \"" | ||
- | foreach ($oitemVal-> | ||
- | $text .= " \" | ||
- | } $oContentVal=""; | ||
- | $text .= " | ||
- | $text .= $oitemVal-> | ||
- | $text .= $oitemVal-> | ||
- | foreach ($oitemVal-> | ||
- | $text .= " \" | ||
- | } $oContentVal=""; | ||
- | $text .= " | ||
- | $text .= $oitemVal-> | ||
- | |||
- | $text .= " | ||
- | echo " | ||
- | fwrite($myfile, | ||
- | } | ||
- | |||
- | $text=''; | ||
- | |||
- | } | ||
- | |||
- | fclose($myfile); | ||
- | |||
- | ?> | ||
- | </ | ||
- | </ | ||
c/nmp/using_open_api_example.1495410873.txt.gz · Last modified: 2017/05/22 08:24 by hkimscil