Giter Club home page Giter Club logo

tweetwikidatadeaths's Introduction

tweetbot with R

A small demonstration of a docker container that runs a R-script Keep in mind that this is a rather unsafe method to use your twitter keys you're much better of supplying them as arguments at build time.

Instructions to run the docker container

  • CD into the tweet folder
  • modify the Rscript
  • docker build to build the container
  • docker run to run the container
cd tweet
# modify the R script (you'd be wise to change the keys or use 
# a different way to add these keys to the image)
sudo docker build -t 'wikidatabot:v1'  .
sudo docker run wikidatabot:v1

Explanation of technology used

This container builds on the r-base container and installs all packages needed for the script to run. Unfortunately those are a lot of packages.

The script uses wikidataqueryr to query wikidata and retrieve a list of deaths. It selects one of those, glues the information from that death together and sends a tweet out with rtweet.

Running this script on heroku

The init.R file is used on heroku.

  • Install the heroku commandline app.

  • Select the init.R and script.R file and commit them

  • run the following commands (the buildpack is external)

heroku --create 
heroku buildpacks:set https://github.com/virtualstaticvoid/heroku-buildpack-r.git#heroku-16
heroku stack:set 'heroku-16'
git push heroku master

To make it run automatically every day you have to enable the scheduler. You need to add a creditcard.

  • in the schedular set this command: Rscript app/script.R

it now runs whenever you want to.

tweetwikidatadeaths's People

Contributors

rmhogervorst avatar

Stargazers

Sam Abbott avatar Robert Hawlik avatar Mr. Yap avatar

Watchers

James Cloos avatar  avatar  avatar

tweetwikidatadeaths's Issues

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.