<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Twitter_streamR_scraper.R</id>
	<title>Twitter streamR scraper.R - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Twitter_streamR_scraper.R"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Twitter_streamR_scraper.R&amp;action=history"/>
	<updated>2026-04-28T01:16:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Twitter_streamR_scraper.R&amp;diff=46699&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot; #install.packages(&quot;streamR&quot;)  #install.packages(&quot;ROAuth&quot;)  library(ROAuth)  library(streamR)    #sets your working directory  setwd(&#039;/home/stats/data&#039;)    #create your OAuth...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Twitter_streamR_scraper.R&amp;diff=46699&amp;oldid=prev"/>
		<updated>2017-01-28T03:15:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; #install.packages(&amp;quot;streamR&amp;quot;)  #install.packages(&amp;quot;ROAuth&amp;quot;)  library(ROAuth)  library(streamR)    #sets your working directory  setwd(&amp;#039;/home/stats/data&amp;#039;)    #create your OAuth...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; #install.packages(&amp;quot;streamR&amp;quot;)&lt;br /&gt;
 #install.packages(&amp;quot;ROAuth&amp;quot;)&lt;br /&gt;
 library(ROAuth)&lt;br /&gt;
 library(streamR)&lt;br /&gt;
 &lt;br /&gt;
 #sets your working directory&lt;br /&gt;
 setwd(&amp;#039;/home/stats/data&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
 #create your OAuth credential&lt;br /&gt;
 credential &amp;lt;- OAuthFactory$new(consumerKey=&amp;#039;***CONSUMER KEY***&amp;#039;,&lt;br /&gt;
                          consumerSecret=&amp;#039;***CONSUMER SECRET KEY***&amp;#039;,&lt;br /&gt;
                          requestURL=&amp;#039;https://api.twitter.com/oauth/request_token&amp;#039;,&lt;br /&gt;
                          accessURL=&amp;#039;https://api.twitter.com/oauth/access_token&amp;#039;,&lt;br /&gt;
                          authURL=&amp;#039;https://api.twitter.com/oauth/authorize&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
 #authentication process&lt;br /&gt;
 options(RCurlOptions = list(cainfo = system.file(&amp;quot;CurlSSL&amp;quot;, &amp;quot;cacert.pem&amp;quot;, package = &amp;quot;RCurl&amp;quot;)))&lt;br /&gt;
 download.file(url=&amp;quot;http://curl.haxx.se/ca/cacert.pem&amp;quot;, destfile=&amp;quot;cacert.pem&amp;quot;)&lt;br /&gt;
 credential$handshake(cainfo=&amp;quot;cacert.pem&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 #function to actually scrape Twitter&lt;br /&gt;
 filterStream( file.name=&amp;quot;tweets_test.json&amp;quot;,&lt;br /&gt;
              track=&amp;quot;twitter&amp;quot;, tweets=1000, oauth=credential, timeout=10, lang=&amp;#039;en&amp;#039; )&lt;br /&gt;
 &lt;br /&gt;
 #Parses the tweets&lt;br /&gt;
 tweet_df &amp;lt;- parseTweets(tweets=&amp;#039;tweets_test.json&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
 #using the Twitter dataframe&lt;br /&gt;
 tweet_df$created_at&lt;br /&gt;
 tweet_df$text&lt;br /&gt;
 &lt;br /&gt;
 plot(tweet_df$friends_count, tweet_df$followers_count) #plots scatterplot&lt;br /&gt;
 cor(tweet_df$friends_count, tweet_df$followers_count) #returns the correlation coefficient&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Referensi==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/seandolinar/Twitter-Tutorial/blob/master/twitter_streamR_scraper.R&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>