Giter VIP home page Giter VIP logo

rtweet's Introduction

rtweet

Build Status CRAN_Status_Badge Downloads Downloads Travis-CI Build Status Coverage Status

R client for collecting data via Twitter's REST and stream API's.

Install

To get the current released version from CRAN:

install.packages("rtweet")
library(rtweet)

To get the current development version from github:

install.packages("devtools")
devtools::install_github("mkearney/rtweet")

Communicating with Twitter's APIs can, at times, be inconsistent. With that said, if you encounter an obvious bug for which there is not already an active issue, please create a new issue with all code used (preferably a reproducible example) on Github. For questions or other discussion, please use rtweet's Google group.

Getting started

  • Quick authorization method: To make your life easier, follow the recommended steps in obtaining and using access tokens. However, for a quick start (note: much slower in long term), you can also follow the instructions below or via the rtweet documentation website.

  • First, you'll need to create a Twitter app. For the callback field, make sure to enter: http://127.0.0.1:1410.

  • Once you've created an app, record your consumer (api) and secret keys. Screeshots can be found here.

  • Generate a token by using the create_token() function.

## name assigned to created app
appname <- "rtweet_token"
## api key (example below is not a real key)
key <- "XYznzPFOFZR2a39FwWKN1Jp41"
## api secret (example below is not a real key)
secret <- "CtkGEWmSevZqJuKl6HHrBxbCybxI1xGLqrD5ynPd9jG0SoHZbD"
twitter_token <- create_token(
    app = appname,
    consumer_key = key,
    consumer_secret = secret)
  • Once twitter_token is part of your global environment, rtweet functions should find it. However, using this method, the token will not automatically load in future sessions (you'll need to create a token every time you start a new session).

  • Although not necessary, functions also accept tokens via the token argument. For example:

rt <- search_tweets("data science", n = 1000, token = twitter_token)

Package description

More technical description: An implementation of calls designed to extract and organize Twitter data via Twitter's REST and stream API's. Functions formulate GET and POST requests and convert response objects to more user friendly structures, e.g., data frames or lists. Specific consideration is given to functions designed to return tweets data from searches, streams, and timelines and user ids from friends and followers lists.

Contact

rtweet's Google group

Vignettes

rtweet's People

Contributors

yutannihilation avatar suppaman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.