Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
8955787a
Commit
8955787a
authored
11 years ago
by
James Phillpotts
Browse files
Options
Downloads
Patches
Plain Diff
Twitter API v1 is retired - username/password auth no longer possible
parent
93a16434
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
streaming/src/main/scala/spark/streaming/StreamingContext.scala
+1
-15
1 addition, 15 deletions
...ing/src/main/scala/spark/streaming/StreamingContext.scala
with
1 addition
and
15 deletions
streaming/src/main/scala/spark/streaming/StreamingContext.scala
+
1
−
15
View file @
8955787a
...
...
@@ -27,7 +27,7 @@ import org.apache.hadoop.mapreduce.{InputFormat => NewInputFormat}
import
org.apache.hadoop.mapreduce.lib.input.TextInputFormat
import
org.apache.hadoop.fs.Path
import
twitter4j.Status
import
twitter4j.auth.
{
Authorization
,
BasicAuthorization
}
import
twitter4j.auth.Authorization
/**
* A StreamingContext is the main entry point for Spark Streaming functionality. Besides the basic
...
...
@@ -361,20 +361,6 @@ class StreamingContext private (
fileStream
[
LongWritable
,
Text
,
TextInputFormat
](
directory
).
map
(
_
.
_2
.
toString
)
}
/**
* Create a input stream that returns tweets received from Twitter.
* @param username Twitter username
* @param password Twitter password
* @param filters Set of filter strings to get only those tweets that match them
* @param storageLevel Storage level to use for storing the received objects
*/
def
twitterStream
(
username
:
String
,
password
:
String
,
filters
:
Seq
[
String
]
=
Nil
,
storageLevel
:
StorageLevel
=
StorageLevel
.
MEMORY_AND_DISK_SER_2
)
:
DStream
[
Status
]
=
twitterStream
(
new
BasicAuthorization
(
username
,
password
),
filters
,
storageLevel
)
/**
* Create a input stream that returns tweets received from Twitter.
* @param twitterAuth Twitter4J authentication
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment