<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://info319.wiki.uib.no/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vimala</id>
	<title>info319 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://info319.wiki.uib.no/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vimala"/>
	<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/Special:Contributions/Vimala"/>
	<updated>2026-04-20T15:07:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Essay&amp;diff=826</id>
		<title>Essay</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Essay&amp;diff=826"/>
		<updated>2020-11-17T09:26:16Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The essay shall present and discuss selected theory, technology and tools related to the big data and emergency management, backed by scholarly and other references.&lt;br /&gt;
&lt;br /&gt;
This autumn, we specifically invite essays that are preferably related to either big data, IoT, social media and emergency management.&lt;br /&gt;
&lt;br /&gt;
== Theme ==&lt;br /&gt;
Your mandatory essay is supposed to be &amp;quot;an individual, theoretical essay on chosen topic&amp;quot;. In practice, it is you who propose a theme, and then I either accept it as is or guide you towards a more suitable theme.&lt;br /&gt;
&lt;br /&gt;
I am open for essays that are not theoretical, but based on your own investigation and data collection, for example through interviews and/or archival analyses. But in any case, your essay should demonstrate &amp;quot;thoughtful research and discussion&amp;quot;. It should be well backed by scholarly literature. More literature backing is needed if you have not done any investigation/data collection of your own beyond your literature search.&lt;br /&gt;
&lt;br /&gt;
== Finding a theme ==&lt;br /&gt;
It is a good idea to start thinking about possible essay themes already now. At least to get the processes started! Send me your ideas in an email, and I will provide early feedback. All I need is a few keywords or a sentence about one or more ideas your are considering. Later we can talk face to face.&lt;br /&gt;
&lt;br /&gt;
* Here is an example of an initial idea on the keyword stage: &amp;quot;Ethics and Privacy in using social media for emergency management.&amp;quot;&lt;br /&gt;
* A step further: &amp;quot;I want to look into interoperability of different freely available emergency data sources using big data technologies. What information is needed? who needed?&amp;quot;&lt;br /&gt;
* Here is an even more developed idea: &amp;quot;Something about how realistic it is to analyse lots of Twitter messages using sentiment analysers. Analysing messages takes computing resources, and there are so many Twitter messages posted after an emergency occurrence. I want to write something about the accuracy of the twitter data analysis.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Proposing a theme/ Selection deadline ==&lt;br /&gt;
Everyone who intends to take the course must send an essay proposal by email to [mailto:vimala.nunavath@usn.no vimala.nunavath@usn.no].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deadline:&#039;&#039;&#039; Friday August 28th 1400&lt;br /&gt;
&lt;br /&gt;
The proposal does not have to be long, but the following points must be made clear:&lt;br /&gt;
*    Which problem or opportunity you are planning to address.&lt;br /&gt;
*    Why this problem or opportunity is real.&lt;br /&gt;
*    How you are going to investigate the problem or opportunity.&lt;br /&gt;
*    Which relevant literature or other information sources you know already.&lt;br /&gt;
*    How your are going to find more suitable literature.&lt;br /&gt;
*    Whether you plan to collect your own data and, if so, from where and how.&lt;br /&gt;
*    And, if so, how you are going to present and use them in your essay.&lt;br /&gt;
*    How you plan to structure the essay (coarsely).&lt;br /&gt;
&lt;br /&gt;
== Length ==&lt;br /&gt;
Suggested length is 4000-6000 words. A theoretical essay should normally be a little longer than an essay based on own data collection. But effort quality is much more important than length. I encourage submitting the essay wholly or partially as one or several Wikipedia pages, or as clear extensions to existing pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Essay submission ==&lt;br /&gt;
&#039;&#039;&#039;Hard deadline:&#039;&#039;&#039; Friday November 20th 1400&lt;br /&gt;
&lt;br /&gt;
Essays are submitted through Inspera in PDF format. The file name and title page should clearly indicate who the author is.&lt;br /&gt;
&lt;br /&gt;
== Evaluation criteria ==&lt;br /&gt;
These are the main evaluation criteria we will use:&lt;br /&gt;
*    Clear, good and well-motivated problem.&lt;br /&gt;
*    Extent and coverage of your literature, in particular of the academic research literature.&lt;br /&gt;
*    Depth of literature is more important than breadth.&lt;br /&gt;
*    Originality, in particular of your independent/own contribution.&lt;br /&gt;
*    How well argued and/or empirically backed the contribution is.&lt;br /&gt;
*    Extent: how hard you have worked and how much you have done.&lt;br /&gt;
*    Quality of presentation.&lt;br /&gt;
&lt;br /&gt;
== Essay presentations ==&lt;br /&gt;
The session on Thursday, November 26th will focus on essay presentations. 10 minutes and around 5-8 slides are an appropriate length.&lt;br /&gt;
&lt;br /&gt;
Depending on the number of people who take the course, we may not have much time per essay. This includes: getting your slides up and running, presenting the actual essay, presenting critique, and posing/answering questions. In addition to presenting your own essay. you are supposed to offer comments to at least one other essay.&lt;br /&gt;
&lt;br /&gt;
This means that you need to be really well prepared. A short presentation is much harder than a long one: &amp;quot;Lincoln [... w]hen asked to appear upon some important occasion and deliver a five-minute speech, he said that he had no time to prepare five-minute speeches, but that he could go and speak an hour at any time.&amp;quot; (H. H. Markham, Governor of California, 1893)&lt;br /&gt;
&lt;br /&gt;
== Presentation outline ==&lt;br /&gt;
The presentation form is up to you, but you should probably touch most of these points:&lt;br /&gt;
* What is the problem you have addressed?&lt;br /&gt;
* Why is this problem important?&lt;br /&gt;
* Which existing area(s) of research and/or practice are you building on?&lt;br /&gt;
** explain the ones we have not yet touched in the course!&lt;br /&gt;
** spend some time on this: for the listeners it may be the most interesting part&lt;br /&gt;
* What is your independent/own contribution?&lt;br /&gt;
** examples: how your field(s) has evolved over time; missing knowledge/research; own data collection, e.g., through interviews; comparing different approaches - in practice or theory; designing a new solution for something; suggesting a framework of how different contributions fit together and are different; ...&lt;br /&gt;
* What has been your strategy to make that contribution?&lt;br /&gt;
** how did you convince the reader that your contribution was sound?&lt;br /&gt;
* Which academic research literature did you use (in addition to the curriculum in INFO319)?&lt;br /&gt;
** show your literature list, but don&#039;t try to explain the papers :-)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; Upload your draft presentations to the portal in advance on Wednesday December 4rth. Upload them in the folder EssayPresentations in Canvas (https://mitt.uib.no/courses/13673/).&lt;br /&gt;
&lt;br /&gt;
== Essay oppositions ==&lt;br /&gt;
These are very brief and even more free form. You could address two or more of the issues below, or perhaps other ones. Do not try to address them all:&lt;br /&gt;
* Have you got reasons to think this problem unclear - if so how?&lt;br /&gt;
* Have you got reasons to think this problem is less relevant?&lt;br /&gt;
* Are there other areas of research and/or practice that are relevant here?&lt;br /&gt;
* Do you think the plan for an independent/own contribution are realistic? Is it the right type of contribution?&lt;br /&gt;
* Do you think this contribution is likely to be convincing? If no, which problems do you see?&lt;br /&gt;
* Have you got concrete ideas for finding more literature (but not just: maybe you can search in the library/on the internet...)?&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Essay&amp;diff=825</id>
		<title>Essay</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Essay&amp;diff=825"/>
		<updated>2020-11-17T09:24:46Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The essay shall present and discuss selected theory, technology and tools related to the big data and emergency management, backed by scholarly and other references.&lt;br /&gt;
&lt;br /&gt;
This autumn, we specifically invite essays that are preferably related to either big data, IoT, social media and emergency management.&lt;br /&gt;
&lt;br /&gt;
== Theme ==&lt;br /&gt;
Your mandatory essay is supposed to be &amp;quot;an individual, theoretical essay on chosen topic&amp;quot;. In practice, it is you who propose a theme, and then I either accept it as is or guide you towards a more suitable theme.&lt;br /&gt;
&lt;br /&gt;
I am open for essays that are not theoretical, but based on your own investigation and data collection, for example through interviews and/or archival analyses. But in any case, your essay should demonstrate &amp;quot;thoughtful research and discussion&amp;quot;. It should be well backed by scholarly literature. More literature backing is needed if you have not done any investigation/data collection of your own beyond your literature search.&lt;br /&gt;
&lt;br /&gt;
== Finding a theme ==&lt;br /&gt;
It is a good idea to start thinking about possible essay themes already now. At least to get the processes started! Send me your ideas in an email, and I will provide early feedback. All I need is a few keywords or a sentence about one or more ideas your are considering. Later we can talk face to face.&lt;br /&gt;
&lt;br /&gt;
* Here is an example of an initial idea on the keyword stage: &amp;quot;Ethics and Privacy in using social media for emergency management.&amp;quot;&lt;br /&gt;
* A step further: &amp;quot;I want to look into interoperability of different freely available emergency data sources using big data technologies. What information is needed? who needed?&amp;quot;&lt;br /&gt;
* Here is an even more developed idea: &amp;quot;Something about how realistic it is to analyse lots of Twitter messages using sentiment analysers. Analysing messages takes computing resources, and there are so many Twitter messages posted after an emergency occurrence. I want to write something about the accuracy of the twitter data analysis.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Proposing a theme/ Selection deadline ==&lt;br /&gt;
Everyone who intends to take the course must send an essay proposal by email to [mailto:vimala.nunavath@usn.no vimala.nunavath@usn.no].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deadline:&#039;&#039;&#039; Friday August 28th 1400&lt;br /&gt;
&lt;br /&gt;
The proposal does not have to be long, but the following points must be made clear:&lt;br /&gt;
*    Which problem or opportunity you are planning to address.&lt;br /&gt;
*    Why this problem or opportunity is real.&lt;br /&gt;
*    How you are going to investigate the problem or opportunity.&lt;br /&gt;
*    Which relevant literature or other information sources you know already.&lt;br /&gt;
*    How your are going to find more suitable literature.&lt;br /&gt;
*    Whether you plan to collect your own data and, if so, from where and how.&lt;br /&gt;
*    And, if so, how you are going to present and use them in your essay.&lt;br /&gt;
*    How you plan to structure the essay (coarsely).&lt;br /&gt;
*    Whether you plan to publish the essay on some kind of social media.&lt;br /&gt;
&lt;br /&gt;
== Length ==&lt;br /&gt;
Suggested length is 4000-6000 words. A theoretical essay should normally be a little longer than an essay based on own data collection. But effort quality is much more important than length. I encourage submitting the essay wholly or partially as one or several Wikipedia pages, or as clear extensions to existing pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Essay submission ==&lt;br /&gt;
&#039;&#039;&#039;Hard deadline:&#039;&#039;&#039; Friday November 20th 1400&lt;br /&gt;
&lt;br /&gt;
Essays are submitted through Inspera in PDF format. The file name and title page should clearly indicate who the author is.&lt;br /&gt;
&lt;br /&gt;
== Evaluation criteria ==&lt;br /&gt;
These are the main evaluation criteria we will use:&lt;br /&gt;
*    Clear, good and well-motivated problem.&lt;br /&gt;
*    Extent and coverage of your literature, in particular of the academic research literature.&lt;br /&gt;
*    Depth of literature is more important than breadth.&lt;br /&gt;
*    Originality, in particular of your independent/own contribution.&lt;br /&gt;
*    How well argued and/or empirically backed the contribution is.&lt;br /&gt;
*    Extent: how hard you have worked and how much you have done.&lt;br /&gt;
*    Quality of presentation.&lt;br /&gt;
&lt;br /&gt;
== Essay presentations ==&lt;br /&gt;
The session on Thursday, November 26th will focus on essay presentations. 10 minutes and around 5-8 slides are an appropriate length.&lt;br /&gt;
&lt;br /&gt;
Depending on the number of people who take the course, we may not have much time per essay. This includes: getting your slides up and running, presenting the actual essay, presenting critique, and posing/answering questions. In addition to presenting your own essay. you are supposed to offer comments to at least one other essay.&lt;br /&gt;
&lt;br /&gt;
This means that you need to be really well prepared. A short presentation is much harder than a long one: &amp;quot;Lincoln [... w]hen asked to appear upon some important occasion and deliver a five-minute speech, he said that he had no time to prepare five-minute speeches, but that he could go and speak an hour at any time.&amp;quot; (H. H. Markham, Governor of California, 1893)&lt;br /&gt;
&lt;br /&gt;
== Presentation outline ==&lt;br /&gt;
The presentation form is up to you, but you should probably touch most of these points:&lt;br /&gt;
* What is the problem you have addressed?&lt;br /&gt;
* Why is this problem important?&lt;br /&gt;
* Which existing area(s) of research and/or practice are you building on?&lt;br /&gt;
** explain the ones we have not yet touched in the course!&lt;br /&gt;
** spend some time on this: for the listeners it may be the most interesting part&lt;br /&gt;
* What is your independent/own contribution?&lt;br /&gt;
** examples: how your field(s) has evolved over time; missing knowledge/research; own data collection, e.g., through interviews; comparing different approaches - in practice or theory; designing a new solution for something; suggesting a framework of how different contributions fit together and are different; ...&lt;br /&gt;
* What has been your strategy to make that contribution?&lt;br /&gt;
** how did you convince the reader that your contribution was sound?&lt;br /&gt;
* Which academic research literature did you use (in addition to the curriculum in INFO319)?&lt;br /&gt;
** show your literature list, but don&#039;t try to explain the papers :-)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; Upload your draft presentations to the portal in advance on Wednesday December 4rth. Upload them in the folder EssayPresentations in Canvas (https://mitt.uib.no/courses/13673/).&lt;br /&gt;
&lt;br /&gt;
== Essay oppositions ==&lt;br /&gt;
These are very brief and even more free form. You could address two or more of the issues below, or perhaps other ones. Do not try to address them all:&lt;br /&gt;
* Have you got reasons to think this problem unclear - if so how?&lt;br /&gt;
* Have you got reasons to think this problem is less relevant?&lt;br /&gt;
* Are there other areas of research and/or practice that are relevant here?&lt;br /&gt;
* Do you think the plan for an independent/own contribution are realistic? Is it the right type of contribution?&lt;br /&gt;
* Do you think this contribution is likely to be convincing? If no, which problems do you see?&lt;br /&gt;
* Have you got concrete ideas for finding more literature (but not just: maybe you can search in the library/on the internet...)?&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Final_exam&amp;diff=824</id>
		<title>Final exam</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Final_exam&amp;diff=824"/>
		<updated>2020-11-13T13:57:33Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Final Exam is on 1st December, 2020.&lt;br /&gt;
&lt;br /&gt;
Reading material for exam:&lt;br /&gt;
&lt;br /&gt;
*Rob Kitchin. The Data Revolution - Big Data, Open Data, Data Infrastructures &amp;amp; Their Consequences. Sage, 2014.&lt;br /&gt;
*Carlos Castillo. Big Crisis Data - Social Media in Disasters and Time-Critical Situations. Cambridge, 2016.&lt;br /&gt;
*Lecture slides in Canvas.&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=823</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=823"/>
		<updated>2020-10-29T15:48:49Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* I will share the jupyter notebook (which contains the python code) and dataset during the practical session&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://github.com/tthustla/setiment_analysis_pyspark/blob/master/Sentiment%20Analysis%20with%20PySpark.ipynb Sentiment Analysis with Pyspark]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
*[https://dzone.com/articles/streaming-machine-learning-pipeline-for-sentiment Sentiment analysis with Apache Spark streaming and MLlib]] or [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with pyspark:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://towardsdatascience.com/sentiment-analysis-with-pyspark-bc8e83f80c35/ Sentiment Analysis with pyspark] or [https://databricks.com/wp-content/uploads/2015/10/STEP-3-Sentiment_Analysis.html]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Real-time Analysis of different trends in COVID-19 cases with Spark&#039;&#039;&#039;&lt;br /&gt;
**[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=822</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=822"/>
		<updated>2020-10-29T15:48:09Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* I will share the jupyter notebook (which contains the python code) during the practical session&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://github.com/tthustla/setiment_analysis_pyspark/blob/master/Sentiment%20Analysis%20with%20PySpark.ipynb Sentiment Analysis with Pyspark]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
*[https://dzone.com/articles/streaming-machine-learning-pipeline-for-sentiment Sentiment analysis with Apache Spark streaming and MLlib]] or [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with pyspark:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://towardsdatascience.com/sentiment-analysis-with-pyspark-bc8e83f80c35/ Sentiment Analysis with pyspark] or [https://databricks.com/wp-content/uploads/2015/10/STEP-3-Sentiment_Analysis.html]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Real-time Analysis of different trends in COVID-19 cases with Spark&#039;&#039;&#039;&lt;br /&gt;
**[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=821</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=821"/>
		<updated>2020-10-29T15:34:15Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://github.com/tthustla/setiment_analysis_pyspark/blob/master/Sentiment%20Analysis%20with%20PySpark.ipynb Sentiment Analysis with Pyspark]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
*[https://dzone.com/articles/streaming-machine-learning-pipeline-for-sentiment Sentiment analysis with Apache Spark streaming and MLlib]] or [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with pyspark:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://towardsdatascience.com/sentiment-analysis-with-pyspark-bc8e83f80c35/ Sentiment Analysis with pyspark] or [https://databricks.com/wp-content/uploads/2015/10/STEP-3-Sentiment_Analysis.html]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Real-time Analysis of different trends in COVID-19 cases with Spark&#039;&#039;&#039;&lt;br /&gt;
**[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=820</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=820"/>
		<updated>2020-10-29T15:31:48Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
*[https://dzone.com/articles/streaming-machine-learning-pipeline-for-sentiment Sentiment analysis with Apache Spark streaming and MLlib]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with pyspark:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://towardsdatascience.com/sentiment-analysis-with-pyspark-bc8e83f80c35/ Sentiment Analysis with pyspark] or [https://databricks.com/wp-content/uploads/2015/10/STEP-3-Sentiment_Analysis.html]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Real-time Analysis of different trends in COVID-19 cases with Spark&#039;&#039;&#039;&lt;br /&gt;
**[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=819</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=819"/>
		<updated>2020-10-29T15:30:06Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
*[https://dzone.com/articles/streaming-machine-learning-pipeline-for-sentiment Sentiment analysis with Apache Spark streaming and MLlib]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with pyspark:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://towardsdatascience.com/sentiment-analysis-with-pyspark-bc8e83f80c35/ Sentiment Analysis with pyspark]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Real-time Analysis of different trends in COVID-19 cases with Spark&#039;&#039;&#039;&lt;br /&gt;
**[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=818</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=818"/>
		<updated>2020-10-29T15:29:53Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
*[https://dzone.com/articles/streaming-machine-learning-pipeline-for-sentiment/ Sentiment analysis with Apache Spark streaming and MLlib]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with pyspark:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://towardsdatascience.com/sentiment-analysis-with-pyspark-bc8e83f80c35/ Sentiment Analysis with pyspark]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) Real-time Analysis of different trends in COVID-19 cases with Spark&#039;&#039;&#039;&lt;br /&gt;
**[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=817</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=817"/>
		<updated>2020-10-29T15:28:05Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with pyspark:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://towardsdatascience.com/sentiment-analysis-with-pyspark-bc8e83f80c35/ Sentiment Analysis with pyspark]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=816</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=816"/>
		<updated>2020-10-29T15:27:53Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://towardsdatascience.com/sentiment-analysis-with-pyspark-bc8e83f80c35/ Sentiment Analysis with pyspark]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=815</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=815"/>
		<updated>2020-10-29T15:26:24Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Analysis of different trends in COVID-19 cases with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=814</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=814"/>
		<updated>2020-10-29T15:25:37Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://community.ibm.com/community/user/watsonstudio/blogs/sharyn-richard1/2020/04/15/analysis-of-johns-hopkins-covid-19-case-data/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=813</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=813"/>
		<updated>2020-10-29T15:24:15Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2017/09/twitter-sentiment-analysis-using-spark/ | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=812</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=812"/>
		<updated>2020-10-29T15:23:09Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2016/09/spark-streaming-part-1-real-time | Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=811</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=811"/>
		<updated>2020-10-29T13:17:54Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[[:File:guide-20.pdf|Installation guide for Spark streaming for scala]]&lt;br /&gt;
&lt;br /&gt;
For python:&lt;br /&gt;
&lt;br /&gt;
*[[https://github.com/jleetutorial/python-spark-streaming |Python Spark Streaming Code]]&lt;br /&gt;
*[[https://learning.oreilly.com/videos/apache-spark-streaming/9781789808223/9781789808223-video1_5|Python Spark Streaming Video]]&lt;br /&gt;
*[[https://medium.com/@ch.nabarun/easy-to-play-with-twitter-data-using-spark-structured-streaming-76fe86f1f81c |Spark Structured Streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps for SCALA:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;your key&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=810</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=810"/>
		<updated>2020-10-28T16:07:39Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[[:File:guide-20.pdf|Installation guide for Spark streaming for scala]]&lt;br /&gt;
&lt;br /&gt;
For python:&lt;br /&gt;
&lt;br /&gt;
*[[https://github.com/jleetutorial/python-spark-streaming |Python Spark Streaming Code]]&lt;br /&gt;
*[[https://learning.oreilly.com/videos/apache-spark-streaming/9781789808223/9781789808223-video1_5|Python Spark Streaming Video]]&lt;br /&gt;
*[[https://medium.com/@ch.nabarun/easy-to-play-with-twitter-data-using-spark-structured-streaming-76fe86f1f81c|Spark Structured Streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps for SCALA:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;your key&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=809</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=809"/>
		<updated>2020-10-28T15:55:22Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[[:File:guide-20.pdf|Installation guide for Spark streaming for scala]]&lt;br /&gt;
&lt;br /&gt;
For python:&lt;br /&gt;
*[[https://github.com/jleetutorial/python-spark-streaming |Python Spark Streaming]]&lt;br /&gt;
*[[https://medium.com/@ch.nabarun/easy-to-play-with-twitter-data-using-spark-structured-streaming-76fe86f1f81c|Spark Structured Streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps for SCALA:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;your key&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=808</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=808"/>
		<updated>2020-10-28T08:56:53Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[[:File:guide-20.pdf|Installation guide for Spark streaming]]&lt;br /&gt;
*[[https://github.com/jleetutorial/python-spark-streaming |Python Spark Streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;your key&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=807</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=807"/>
		<updated>2020-10-28T08:56:16Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
*[[https://github.com/jleetutorial/python-spark-streaming |Python Spark Streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;your key&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;your key&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=806</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=806"/>
		<updated>2020-10-26T13:34:12Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
*[[https://github.com/jleetutorial/python-spark-streaming |Python Spark Streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=805</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=805"/>
		<updated>2020-10-26T13:33:51Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
*[[https://github.com/jleetutorial/python-spark-streaming |Example]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=804</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=804"/>
		<updated>2020-10-26T10:24:13Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Guide to Sentiment analysis]&lt;br /&gt;
* [https://stdatalabs.com/2016/09/spark-streaming-part-1-real-time/ Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=803</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=803"/>
		<updated>2020-10-26T10:19:50Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [https://wiki.uib.no/info319/index.php/File:GuideS6.pdf Accessing Sentiment analysis Folder]&lt;br /&gt;
* [https://stdatalabs.com/2016/09/spark-streaming-part-1-real-time/ Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=802</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=802"/>
		<updated>2020-10-26T10:18:34Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [:File:GuideS6.pdf Access to Sentiment analysis folder]&lt;br /&gt;
* [https://stdatalabs.com/2016/09/spark-streaming-part-1-real-time/ Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=801</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=801"/>
		<updated>2020-10-26T10:18:18Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [[[:File:GuideS6.pdf]] Access to Sentiment analysis folder]&lt;br /&gt;
* [https://stdatalabs.com/2016/09/spark-streaming-part-1-real-time/ Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=800</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=800"/>
		<updated>2020-10-26T10:18:09Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [[:File:GuideS6.pdf] Access to Sentiment analysis folder]&lt;br /&gt;
* [https://stdatalabs.com/2016/09/spark-streaming-part-1-real-time/ Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=799</id>
		<title>Practical session, Spark streaming for sentiment analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_sentiment_analysis&amp;diff=799"/>
		<updated>2020-10-26T10:17:49Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Practical Session&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sentiment analysis with Apache Spark streaming and MLlib&#039;&#039;&#039;&lt;br /&gt;
* [[:File:GuideS6.pdf]Access to Sentiment analysis folder]&lt;br /&gt;
* [https://stdatalabs.com/2016/09/spark-streaming-part-1-real-time/ Real-time Sentiment Analysis of Twitter data with Spark Streaming and MLlib]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More useful links&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) Sentiment analysis with Apache Spark streaming and MLlib:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) Sentiment analysis with IBM Bluemix:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://developer.ibm.com/clouddataservices/2016/01/15/real-time-sentiment-analysis-of-twitter-hashtags-with-spark/ Real-time Sentiment Analysis of Twitter Hashtags with Spark and IBM Bluemix]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=File:GuideS6.pdf&amp;diff=798</id>
		<title>File:GuideS6.pdf</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=File:GuideS6.pdf&amp;diff=798"/>
		<updated>2020-10-26T10:17:12Z</updated>

		<summary type="html">&lt;p&gt;Vimala: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=797</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=797"/>
		<updated>2020-10-26T10:09:51Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=796</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=796"/>
		<updated>2020-10-26T10:09:29Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming]&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=795</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=795"/>
		<updated>2020-10-26T10:05:49Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming]&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
* See practical session folder in Canvas&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=794</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=794"/>
		<updated>2020-10-26T10:04:49Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming]&lt;br /&gt;
*[[C:\Users\vnuna\OneDrive - USN\Info319| Spark Streaming]]&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=793</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=793"/>
		<updated>2020-10-26T10:03:22Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming]&lt;br /&gt;
*[[https://www.youtube.com/playlist?list=PLKjwSP1bnrvNotmCafZrIgiuihBgoleV0| Spark Streaming]]&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=792</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=792"/>
		<updated>2020-10-26T10:01:56Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming]&lt;br /&gt;
*[[https://www.youtube.com/playlist?list=PLKjwSP1bnrvNotmCafZrIgiuihBgoleV0| Spark Streaming]]&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
[[Media:SparkStreamingOverview.ogg]]&lt;br /&gt;
[[Media:SparkTwitter.ogg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=791</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=791"/>
		<updated>2020-10-26T09:57:18Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming]&lt;br /&gt;
*[[https://www.youtube.com/playlist?list=PLKjwSP1bnrvNotmCafZrIgiuihBgoleV0| Spark Streaming]]&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=File:Guide-20.pdf&amp;diff=790</id>
		<title>File:Guide-20.pdf</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=File:Guide-20.pdf&amp;diff=790"/>
		<updated>2020-10-26T09:56:46Z</updated>

		<summary type="html">&lt;p&gt;Vimala: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=File:Guide-20.pdf&amp;diff=789</id>
		<title>File:Guide-20.pdf</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=File:Guide-20.pdf&amp;diff=789"/>
		<updated>2020-10-26T09:56:44Z</updated>

		<summary type="html">&lt;p&gt;Vimala: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=788</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=788"/>
		<updated>2020-10-26T09:56:37Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming Folder]&lt;br /&gt;
*[[https://www.youtube.com/playlist?list=PLKjwSP1bnrvNotmCafZrIgiuihBgoleV0| Spark Streaming]]&lt;br /&gt;
*[[:File:guide-20.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=File:Guide.pdf&amp;diff=787</id>
		<title>File:Guide.pdf</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=File:Guide.pdf&amp;diff=787"/>
		<updated>2020-10-26T09:55:39Z</updated>

		<summary type="html">&lt;p&gt;Vimala: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=File:Guide.pdf&amp;diff=786</id>
		<title>File:Guide.pdf</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=File:Guide.pdf&amp;diff=786"/>
		<updated>2020-10-26T09:55:36Z</updated>

		<summary type="html">&lt;p&gt;Vimala: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=784</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=784"/>
		<updated>2020-10-26T09:54:28Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming Folder]&lt;br /&gt;
*[[https://www.youtube.com/playlist?list=PLKjwSP1bnrvNotmCafZrIgiuihBgoleV0| Spark Streaming]]&lt;br /&gt;
*[[:File:Guide.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=783</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=783"/>
		<updated>2020-10-26T09:54:12Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming Folder]&lt;br /&gt;
*[[https://www.youtube.com/playlist?list=PLKjwSP1bnrvNotmCafZrIgiuihBgoleV0|Spark streaming]]&lt;br /&gt;
*[[:File:Guide.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=File:SS.zip&amp;diff=782</id>
		<title>File:SS.zip</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=File:SS.zip&amp;diff=782"/>
		<updated>2020-10-26T09:53:16Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.youtube.com/playlist?list=PLKjwSP1bnrvNotmCafZrIgiuihBgoleV0 Spark Streaming]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=781</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=781"/>
		<updated>2020-10-26T09:44:40Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[https://www.youtube.com/watch?v=2NiT6sK8Yf4/ Accessing Spark streaming Folder]&lt;br /&gt;
*[[:File:SS.zip|Spark streaming Tutorial files]]&lt;br /&gt;
*[[:File:Guide.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=780</id>
		<title>Practical session, Spark streaming for Twitter data analysis</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Practical_session,_Spark_streaming_for_Twitter_data_analysis&amp;diff=780"/>
		<updated>2020-10-26T09:43:51Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Register a Twitter app==&lt;br /&gt;
Create a http://twitter.com account if you do not have one and log into it. &lt;br /&gt;
&lt;br /&gt;
Go to https://apps.twitter.com/ . Make sure you are still logged in: you should see a drop-down menu in the upper right-hand corner of the page.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;Create New App&#039;&#039; and fill in as many details as you can (you can change most of them later). Click &#039;&#039;Create your Twitter application&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Go to &#039;&#039;Keys and Access Tokens&#039;&#039;. Click &#039;&#039;Create my access token&#039;&#039;. You will need the following four key strings need later (keep them secret to protect your Twitter account): &lt;br /&gt;
* Consumer Key (API Key)&lt;br /&gt;
* Consumer Secret (API Secret)&lt;br /&gt;
* Access Token&lt;br /&gt;
* Access Token Secret&lt;br /&gt;
&lt;br /&gt;
==Stream Twitter messages into Spark== &lt;br /&gt;
&#039;&#039;&#039;1) You can use the following links to access the tutorial.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[:File:v1.mp4/ Accessing Spark streaming Folder]&lt;br /&gt;
*[[:File:SS.zip|Spark streaming Tutorial files]]&lt;br /&gt;
*[[:File:Guide.pdf|Installaion guide for Spark streaming]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)Or you can follow the below steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To test that login works, open a &#039;&#039;spark-shell&#039;&#039; (remember the --jars SPARK_JARS option if you defined such an environment variable earlier), and import these APIs:&lt;br /&gt;
    import org.apache.spark._&lt;br /&gt;
    import org.apache.spark.streaming._&lt;br /&gt;
    import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
Set logging level (to avoid warnings from running Spark standalone), and create a new &#039;&#039;spark streaming context (ssc)&#039;&#039;:&lt;br /&gt;
    sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
&lt;br /&gt;
Set system properties for each of your keys and access tokens provided by Twitter earlier:&lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;)  &lt;br /&gt;
    System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;...copy this string from the Twitter app page...&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Create a Spark stream with messages from Twitter:&lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
Because Spark has lazy evaluation, nothing happens until you have defined some transformations on the stream and started it. The next two lines collect messages from Twitter, identified by their &#039;&#039;status&#039;&#039;, split each message text into words, pick out only those words that start with a &#039;&#039;#&#039;&#039;, and print them to the console:&lt;br /&gt;
    val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
    hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
==Starting and stopping streams==&lt;br /&gt;
You are now ready to start the stream:&lt;br /&gt;
    ssc.start&lt;br /&gt;
&lt;br /&gt;
This should write out current hashtags to the console. After a while, stop the stream with:&lt;br /&gt;
    ssc.stop(false, true)&lt;br /&gt;
Here is the documentation page for [https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.streaming.StreamingContext Spark&#039;s StreamingContext and other classes.]&lt;br /&gt;
&lt;br /&gt;
When a streaming context has been stopped, it cannot be restarted, but it can be recreated as follows:&lt;br /&gt;
    val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
    val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
You can create an initialisation file, for example &#039;&#039;init-twitter.scala&#039;&#039;, as follows:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
import org.apache.spark._&lt;br /&gt;
import org.apache.spark.streaming._&lt;br /&gt;
import org.apache.spark.streaming.twitter._&lt;br /&gt;
&lt;br /&gt;
// set Twitter oauth properties&lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerKey&amp;quot;, &amp;quot;2AvbG84msbL34BEHslMsWZTUR&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.consumerSecret&amp;quot;, &amp;quot;gzEENqmZoMl2hhHvDIdaWzIF9ShMSLO0o7gh8csZnfqKdK6Y9H&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessToken&amp;quot;, &amp;quot;14113114-1we8sJQs1z54dWfjWbUwZtDtkQYf3kDOrXLUMBFkZ&amp;quot;)  &lt;br /&gt;
System.setProperty(&amp;quot;twitter4j.oauth.accessTokenSecret&amp;quot;, &amp;quot;6Sq95ezVVRNTuLw7grKzm4czA32VqmlM0QwvaLjWLNl5A&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
// create stream&lt;br /&gt;
sc.setLogLevel(&amp;quot;ERROR&amp;quot;) &lt;br /&gt;
val ssc = new StreamingContext(sc, Seconds(5))  &lt;br /&gt;
val stream = TwitterUtils.createStream(ssc, None)&lt;br /&gt;
&lt;br /&gt;
// define transformations&lt;br /&gt;
val hashTags = stream.flatMap(status =&amp;gt; status.getText.split(&amp;quot; &amp;quot;).filter(_.startsWith(&amp;quot;#&amp;quot;)))&lt;br /&gt;
hashTags.foreachRDD(rdd =&amp;gt; rdd.foreach(str =&amp;gt; println(&amp;quot;:: &amp;quot; + str)))&lt;br /&gt;
&lt;br /&gt;
// start&lt;br /&gt;
ssc.start&lt;br /&gt;
&lt;br /&gt;
// to stop, use: ssc.stop(false, true)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &#039;&#039;spark-shell&#039;&#039; with an initialisation file as follows:&lt;br /&gt;
    spark-shell -i init-twitter.scala&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Todo:&#039;&#039;&#039;&lt;br /&gt;
# partition by hashtag, save message text, save bags of words [https://www.toptal.com/apache/apache-spark-streaming-twitter]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Sessions&amp;diff=779</id>
		<title>Sessions</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Sessions&amp;diff=779"/>
		<updated>2020-10-22T12:25:28Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the schedule for INFO319 in the autumn of 2019. The dates should be fixed at this stage, but the themes may change a little.&lt;br /&gt;
&lt;br /&gt;
== Dates and Tentative Themes ==&lt;br /&gt;
*Monday 2020-08-18 1415: [[Information meeting via Zoom]]&lt;br /&gt;
* Tuesday 2020-08-20 1015: [[Session 1 - Introduction to INFO319 and Emergency Management]]&lt;br /&gt;
* Tuesday 2020-08-20 1400: [[Practical session, trying emergency response tool (Ushahidi)]]&lt;br /&gt;
* Wednesday 2020-08-21 1015: [[Session 2 - Big Data for emergency management]]&lt;br /&gt;
* Wednesday 2020-08-21 1400: [[Practical session, introduction to Spark]],&lt;br /&gt;
* Friday 2020-08-28 14:00 [[Essay | Essay selection deadline]] (email to [mailto:vimala.nunavath@usn.no vimala.nunavath@usn.no])&lt;br /&gt;
* Thursday 2020-10-01 1015: [[Session 3 - Emergency data sources]]&lt;br /&gt;
* Thursday 2020-10-01 1400: [[Practical session, using Spark for emergency datasources]]&lt;br /&gt;
* Friday 2020-10-02 1015: [[Session 4 - Sensors/IoT for Emergency Management]]&lt;br /&gt;
* Friday 2020-10-09 1400:[[Programming project | Project selection deadline]] (email to [mailto:vimala.nunavath@usn.no vimala.nunavath@usn.no])&lt;br /&gt;
* Thursday 2020-10-29 1015: [[Session 5 - Social Media for Emergency Management]]&lt;br /&gt;
* Thursday 2020-10-29 1400: [[Practical session, Spark streaming for Twitter data analysis]]&lt;br /&gt;
* Friday 2020-10-30 1015: [[Session 6 - Machine learning and NLP for EM ]]&lt;br /&gt;
* Friday 2020-10-30 1400: [[Practical session, Spark streaming for sentiment analysis]]&lt;br /&gt;
* Friday 2020-11-20 1400: [[Essay | Essay submission deadline]] (submit PDF-file through Inspera)&lt;br /&gt;
* Thursday 2020-11-26 1015: [[Session 7 - Essay presentations (mandatory)]]&lt;br /&gt;
* Wednesday 2020-11-25 1400: [[Programming project | Project deadline]] (submit ZIP-file through Inspera)&lt;br /&gt;
* Friday 2020-11-27 1015: [[Session 8 - Student programming project presentations (mandatory)]]&lt;br /&gt;
* Tuesday 2020-12.01: Written exam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://tp.uio.no/uib/timeplan/timeplan.php?id=INFO319&amp;amp;type=course&amp;amp;sort=week&amp;amp;sem=18h&amp;amp;lang=en.]&lt;br /&gt;
&lt;br /&gt;
== Locations ==&lt;br /&gt;
* &#039;&#039;&#039;Information meeting:&#039;&#039;&#039; via Zoom.&lt;br /&gt;
* &#039;&#039;&#039;Regular sessions:&#039;&#039;&#039; Lauritz Meltzers hus (the Social Science / SV building), seminar room 548 (6th floor)&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
The regular sessions will be a combination of lectures, student presentations and discussions. You will all be expected to present 3-4 papers/chapters as part of the course. I will try to balance workload evenly (so if some people get two papers and other three, the two papers will be longer and the three papers shorter).&lt;br /&gt;
&lt;br /&gt;
We will try to finish each session by 1600.&lt;br /&gt;
&lt;br /&gt;
== Readings ==&lt;br /&gt;
The detailed readings for each session will be made available on this page in due time.&lt;br /&gt;
&lt;br /&gt;
== Presenting a chapter from the book ==&lt;br /&gt;
*    Prepare presentation for about 20 minutes. We will set off 5-10 more minutes for discussion and comments.&lt;br /&gt;
*    Each slide should contain at least one of the sections from the allocated chapter.&lt;br /&gt;
*    Prepare slides. For a 20 minute presentation, 10 slides is the maximum.&lt;br /&gt;
*    Rehearse a few times beforehand. Talk through the presentation out loud for yourself (not just &amp;quot;inside your head&amp;quot;).&lt;br /&gt;
*    Share your slides by uploading them to the file section here in the portal.&lt;br /&gt;
&lt;br /&gt;
== Presenting a research article ==&lt;br /&gt;
Here are a few points about the paper presentations and preparations:&lt;br /&gt;
*    Make sure you start reading at least a week before, not in the last 2-3 days. You need time to let the paper sink in a bit before you start preparing the presentation. That way it is easier to see and present the big picture.&lt;br /&gt;
*    This may be the first time you read a research paper. I have tried to choose papers that are rather short and simple but, nevertheless, some parts of almost every paper will be hard for you to understand. If you come across difficult details, try to focus on the purpose of what they are doing. When they mention, for example, statistical techniques, I do not expect that you read up on statistics. But explain why they need statistics and tell us the names of the techniques they use and on what data.&lt;br /&gt;
*    Plan each presentation for about 20 minutes. We will set off 5-10 more minutes for discussion and comments.&lt;br /&gt;
*    Prepare slides. For a 20 minute presentation, 10 slides is the maximum.&lt;br /&gt;
*    Your presentation should try to answer at least the following: What is the problem the paper addresses? Why is this an important problem? Are the authors targetting a particular usage domain? What solutions do they propose? How does the solution work? Have they evaluated the solution? If so how? If not yet, how are they planning to evaluate it - or how do you think they should evaluate it? What are the limitations of the proposal? Do you see problems with what they are doing?&lt;br /&gt;
*    These questions are not all suitable for all papers, so you must make a pick! Maybe there are other things you should say about the paper too. Some of the papers mostly describe a problem or a case study, for example, so the presentations will be quite different.&lt;br /&gt;
*    Rehearse a few times beforehand. Talk through the presentation out loud for yourself (not just &amp;quot;inside your head&amp;quot;).&lt;br /&gt;
*    Share your slides by uploading them to the file section here in the portal.&lt;br /&gt;
*    Some papers are longer and some shorter, some easier and some harder. This is how it has to be, but I will try to balance it out so that the workload on each of you is as equal as possible.&lt;br /&gt;
&lt;br /&gt;
== Uploading your presentation ==&lt;br /&gt;
Sharing your presentation slides is a mandatory part of the presentation. You can upload your slides through Inspera in this group &lt;br /&gt;
[https://mitt.uib.no/groups/? mitt.uib.no/groups/?]. If you are not already a member, you can register yourself (the group is open).&lt;br /&gt;
&lt;br /&gt;
Please use file names like this: &amp;quot;Session2-Pathologies-ALO.pdf&amp;quot;, so that &amp;quot;Session2&amp;quot; is the session, &amp;quot;Pathologies&amp;quot; is a central term in the paper title and &amp;quot;ALO&amp;quot; are your initials.&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Session_5_-_Social_Media_for_Emergency_Management&amp;diff=778</id>
		<title>Session 5 - Social Media for Emergency Management</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Session_5_-_Social_Media_for_Emergency_Management&amp;diff=778"/>
		<updated>2020-10-19T12:11:52Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Date:&#039;&#039;&#039; Thursday, October 29th, 2020.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scientific Papers&#039;&#039;&#039;&lt;br /&gt;
* 1)Lu (Lucy) Yan , Alfonso J. Pedraza-Martinez*, &#039;&#039;&#039;Social Media for Disaster Management: Operational Value of the Social Conversation&#039;&#039;&#039;, [[:File:Lu.pdf]].&lt;br /&gt;
* 2)Angel Martína,⁎, Ana Belén Anquela Juliána, Fernando Cos-Gayónb, &#039;&#039;&#039;Analysis of Twitter messages using big data tools to evaluate and locate the activity in the city of Valencia (Spain)&#039;&#039;&#039;, &lt;br /&gt;
[[:File:angel.pdf]].&lt;br /&gt;
* 3) Umair Qazi, Muhammad Imran, Ferda Ofli, &#039;&#039;&#039;GeoCoV19: A Dataset of Hundreds of Millions of Multilingual COVID-19 Tweets with Location Information&#039;&#039;&#039;, [[:File:umair.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Chapters are from the book: Big Data in emergency Management: Exploitation techniques for social and mobile data&#039;&#039;&#039;&lt;br /&gt;
* Chapter 5: Social Media Mining for Disaster Management and Community Resilience by Hemant Purohit and Steve Peterson [chapter can be found in Canvas]&lt;br /&gt;
* Chapter 8: Emergency Information Visualization by Hoang Long Nguyen and Rajendra Akerkar [chapter can be found in Canvas]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Suitable readings:&#039;&#039;&#039; &lt;br /&gt;
* [[http://spark.apache.org/docs/latest/streaming-programming-guide.html Spark Streaming Programming Guide]]&lt;br /&gt;
* [[https://mapr.com/blog/spark-streaming-and-twitter-sentiment-analysis/ Spark Streaming, Minimized]]&lt;br /&gt;
* [https://www.infoq.com/articles/apache-spark-streaming Spark Streaming]&lt;br /&gt;
*[[https://www.the-lazy-dev.com/en/spark-for-beginners-tutorials-apache-spark-streaming-twitter-java-example/ Create a Twitter developer account]]&lt;br /&gt;
* Social media and disasters: Current uses, future options, and policy considerations: [[:File:CRS.pdf]]&lt;br /&gt;
* [http://infolab.stanford.edu/~ullman/mmds/ch10.pdf Social Network Graphs]&lt;br /&gt;
&#039;&#039;&#039;Topics:&#039;&#039;&#039;&lt;br /&gt;
* Follow up:&lt;br /&gt;
**  about the programming project topics&lt;br /&gt;
&lt;br /&gt;
* Paper presentations by you:&lt;br /&gt;
**See Canvas for paper allocation&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Slides:&#039;&#039;&#039; &lt;br /&gt;
Session-5: [[See canvas]]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Session_5_-_Social_Media_for_Emergency_Management&amp;diff=777</id>
		<title>Session 5 - Social Media for Emergency Management</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Session_5_-_Social_Media_for_Emergency_Management&amp;diff=777"/>
		<updated>2020-10-19T11:19:45Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Date:&#039;&#039;&#039; Thursday, October 29th, 2020.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scientific Papers&#039;&#039;&#039;&lt;br /&gt;
* 1)Lu (Lucy) Yan , Alfonso J. Pedraza-Martinez*, &#039;&#039;&#039;Social Media for Disaster Management: Operational Value of the Social Conversation&#039;&#039;&#039;, [[:File:Lu.pdf]].&lt;br /&gt;
* 2)Angel Martína,⁎, Ana Belén Anquela Juliána, Fernando Cos-Gayónb, &#039;&#039;&#039;Analysis of Twitter messages using big data tools to evaluate and locate the activity in the city of Valencia (Spain)&#039;&#039;&#039;, &lt;br /&gt;
[[:File:angel.pdf]].&lt;br /&gt;
* 3) Umair Qazi, Muhammad Imran, Ferda Ofli, &#039;&#039;&#039;GeoCoV19: A Dataset of Hundreds of Millions of Multilingual COVID-19 Tweets with Location Information&#039;&#039;&#039;, [[:File:umair.pdf]]&lt;br /&gt;
* 4)Ferda Ofli, Firoj Alam, Muhammad Imran, &#039;&#039;&#039;Analysis of Social Media Data using Multimodal Deep Learning for Disaster Response&#039;&#039;&#039;, [[:File:ofli.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Chapters are from the book: Big Data in emergency Management: Exploitation techniques for social and mobile data&#039;&#039;&#039;&lt;br /&gt;
* Chapter 5: Social Media Mining for Disaster Management and Community Resilience by Hemant Purohit and Steve Peterson [chapter can be found in Canvas]&lt;br /&gt;
* Chapter 8: Emergency Information Visualization by Hoang Long Nguyen and Rajendra Akerkar [chapter can be found in Canvas]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Suitable readings:&#039;&#039;&#039; &lt;br /&gt;
* [[http://spark.apache.org/docs/latest/streaming-programming-guide.html Spark Streaming Programming Guide]]&lt;br /&gt;
* [[https://mapr.com/blog/spark-streaming-and-twitter-sentiment-analysis/ Spark Streaming, Minimized]]&lt;br /&gt;
* [https://www.infoq.com/articles/apache-spark-streaming Spark Streaming]&lt;br /&gt;
*[[https://www.the-lazy-dev.com/en/spark-for-beginners-tutorials-apache-spark-streaming-twitter-java-example/ Create a Twitter developer account]]&lt;br /&gt;
* Social media and disasters: Current uses, future options, and policy considerations: [[:File:CRS.pdf]]&lt;br /&gt;
* [http://infolab.stanford.edu/~ullman/mmds/ch10.pdf Social Network Graphs]&lt;br /&gt;
&#039;&#039;&#039;Topics:&#039;&#039;&#039;&lt;br /&gt;
* Follow up:&lt;br /&gt;
**  about the programming project topics&lt;br /&gt;
&lt;br /&gt;
* Paper presentations by you:&lt;br /&gt;
**See Canvas for paper allocation&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Slides:&#039;&#039;&#039; &lt;br /&gt;
Session-5: [[See canvas]]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
	<entry>
		<id>http://info319.wiki.uib.no/index.php?title=Session_6_-_Machine_learning_and_NLP_for_EM&amp;diff=776</id>
		<title>Session 6 - Machine learning and NLP for EM</title>
		<link rel="alternate" type="text/html" href="http://info319.wiki.uib.no/index.php?title=Session_6_-_Machine_learning_and_NLP_for_EM&amp;diff=776"/>
		<updated>2020-10-19T11:16:29Z</updated>

		<summary type="html">&lt;p&gt;Vimala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Date:&#039;&#039;&#039; Friday, October 30th, 2020.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scientific papers for presentation&#039;&#039;&#039;&lt;br /&gt;
* 1) Ebtesam Alomari1, Rashid Mehmood2, and Iyad Katib1,2019 &#039;&#039;&#039;Road Traffic Event Detection Using Twitter Data, Machine Learning, and Apache Spark, [[:File:ebtesam.pdf]] &lt;br /&gt;
* 2) J. Rexiline Raginia, P.M. Rubesh Anandb,⁎, Vidhyacharan Bhaskarc, 2018, &#039;&#039;&#039;Big data analytics for disaster response and recovery through sentiment analysis&#039;&#039;&#039;, International Journal of Information Management, PP: 1--13, [[:File:P5-2019.pdf]] &lt;br /&gt;
* 3) Deniz Kılınç, 2019, &#039;&#039;&#039;A Spark-based big data analysis framework for real-time sentiment prediction on streaming data&#039;&#039;&#039;, Journal of Software, Practice and Experience, PP: 1--13, [[:File:P6-2019.pdf]] &lt;br /&gt;
* 4)Van Quan Nguyen , Tien Nguyen Anh and Hyung-Jeong Yang &#039;&#039;&#039;Real-time event detection using recurrent neural network in social sensors&#039;&#039;&#039;, [[:File:van.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Chapter from the Book: The Data Revolution by Rob Kitchin&#039;&#039;&#039;&lt;br /&gt;
* Chapter 6:Data analytics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Chapters from Book:Big Data in emergency Management:Exploitation Techniques for social and mobile data&#039;&#039;&#039;&lt;br /&gt;
* Chapter 4: Knowledge Graphs and Natural-Language Processing [Chapter will be uploaded in Canvas]  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Suitable readings:&#039;&#039;&#039; &lt;br /&gt;
* [https://spark.apache.org/docs/latest/ml-guide.html Machine Learning Library (MLlib) Guide]&lt;br /&gt;
* [https://www.edureka.co/blog/spark-streaming/ Spark Streaming Tutorial – Sentiment Analysis Using Apache Spark]&lt;br /&gt;
* [https://www.technologyreview.com/s/513696/deep-learning/ Artificial intelligence is finally getting smart]&lt;br /&gt;
* [https://www.kaggle.com/kanncaa1/machine-learning-tutorial-for-beginners Machine learning]&lt;br /&gt;
* [https://databricks.com/blog/2014/10/15/application-spotlight-tableau-software.html Data visualization on Tableau with Spark]&lt;br /&gt;
* [https://spark.apache.org/docs/1.4.1/ml-guide.html#pipeline Spark MLlib]&lt;br /&gt;
* Francesco Tarasconi, Michela Farina, Antonio Mazzei, Alessio Bosca, 2017, &#039;&#039;&#039;The Role of Unstructured Data in Real-Time Disaster-related Social Media Monitoring&#039;&#039;&#039;, IEEE International Conference on Big Data, PP:1--10, [[:File:P6a.pdf]].&lt;br /&gt;
&lt;br /&gt;
* Chapter and Paper presentations by you:&lt;br /&gt;
&lt;br /&gt;
** See Canvas for paper allocation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Slides:&#039;&#039;&#039; &lt;br /&gt;
Session-6: [[See canvas]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Useful Links:&#039;&#039;&#039;&lt;br /&gt;
* [https://www.youtube.com/watch?v=5Zg-C8AAIGg The Beauty of Data Visualization by David]&lt;br /&gt;
*[https://www.youtube.com/watch?v=vFu7EFfC-Xc NLP for Social Media]&lt;/div&gt;</summary>
		<author><name>Vimala</name></author>
	</entry>
</feed>