Giter Site home page Giter Site logo

iamvishnurajan / emilytime Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 9 KB

R code for bot that tweets at https://twitter.com/emilyt1m3. Note, this code can be adopted for other Vanity Fair bylines with few simple edits.

License: MIT License

R 100.00%

emilytime's Introduction

emilytime

R code for bot that tweets at https://twitter.com/emilyt1m3

This code polls Emily Jane Fox's author page at Vanity Fair (https://www.vanityfair.com/contributor/emily-jane-fox), and tweets when there is a new article.

Install and Setup Guidance:

The info below is designed for an Linux/Ubuntu setup. It can likely be adpated with little change for MacOS as well.

R prerequisite libraries: rvest, rtweet, lubridate, plyr, dplyr

Save the R code to a directory. i.e., /Users/ejfox_bot/ejfox_bot.R

  1. Edit the lines at the top of the code under the "USER CONFIGURABLE INPUT PARAMETERS" section This is done as follows: 1a. Directories: Pick whatever works for you. A suggested structure and notes are listed in the code comments.

1b. Filename: For the file that will be saved and used as the ongoing base to check for new articles, what do you want the filename to be

1c. Author String: List the author URL on Vanity Fair. For Emily Jane Fox, the full URL is https://www.vanityfair.com/contributor/emily-jane-fox. Just list the "emily-jane-fox" portion here.

1d. Bot Tweet: What do you want the early porton of the tweet to say when the bot tweets.

1e. Twitter token: If you do not have an rtweet twitter token, the method for obtaining and saving one is here: http://rtweet.info/articles/auth.html

  1. Save and rename the provided initial .csv file to the main_dir. This should be consistent with the file naming above in (1b). i.e., so if we picked "ejfox" above, we should ensure the file name is named ejfox.csv.

  2. Create an empty file where errors can be logged. The file must be in the main_dir and must be specifically named std_msgs.txt (Linux/Ubuntu command to do this: touch std_msgs.txt)

  3. At this time, if you run the code, it will populate the file and generate tweets for the articles since the initial .csv was generated (July 11, 2018).

  4. If you want to continue polling and tweeting, schedule as needed so the script begins at reboot. It is designed to be an infinite loop until sometime in the year 2200. It will pickup where it left off when rebooted (that is the main purpose of the .csv file that it writes to).

emilytime's People

Contributors

iamvishnurajan 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.