Description Usage Arguments Details Author(s) Examples
extract.recent.tweets
opens a connection to the Mongo database in
the lab computer and will most recent tweets.
1 2 3 |
set |
string, name of the collection of tweets in the Mongo database to query. |
limit |
number of tweets to be returned. Default is 100, which will return 100 most recent tweets. |
fields |
vector of strings, indicates fields from tweets that will be returned. Default is the date and time of the tweet, its text, and the screen name of the user that published it. See details for full list of possible fields. |
string |
string or vector of strings, set to NULL by default (will return all recent tweets). If it is a string, it will return the number of tweets that contain that string. If it is a vector of string, it will return all tweets that contain at least one of them. |
retweets |
logical, set to NULL by default (will return all tweets).
If |
hashtags |
logical, set to NULL by default (will return all tweets).
If |
verbose |
logical, default is |
The following is a non-exhaustive of relevant fields that can be specified on the
fields
argument (for a complete list, check the documentation at:
https://dev.twitter.com/docs/platform-objects
Tweet: text, created_at, id_str, favorite_count, source, retweeted, r
retweet_count, lang, in_reply_to_status_id, in_reply_to_screen_name
Entities: entities.hashtags, entities.user_mentions, entities.hashtags, entities.urls
Retweeted_status: retweeted_status.text, retweeted_status.created_at... (and all
other tweet, user, and entities fields)
User: user.screen_name, user.id_str, user.geo_enabled, user.location,
user.followers_count, user.statuses_count, user.friends_count,
user.description, user.lang, user.name, user.url, user.created_at, user.time_zone
Geo: geo.coordinates
Pablo Barbera pablo.barbera@nyu.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
## connect to the Mongo database
mongo <- mongo.create("SMAPP_HOST:PORT", db="DATABASE")
mongo.authenticate(mongo, username="USERNAME", password="PASSWORD", db="DATABASE")
set <- "DATABASE.COLLECTION"
## extract text from 100 most recent tweets
tweets <- extract.recent.tweets(set, limit=100, fields="text")
## extract 100 most recent tweets that mention turkey and gezi
tweeets <- extract.recent.tweets(set, limit=100,
string=c("turkey", "gezi"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.