Stub out Mastodon tooting.

This commit is contained in:
mattbk
2018-11-01 12:14:24 -05:00
parent 58c4a1db65
commit e9dd6de0d3
2 changed files with 18 additions and 7 deletions

View File

@ -2,4 +2,8 @@
consumer_key = <your Consumer Key> consumer_key = <your Consumer Key>
access_token = <your Acces Token> access_token = <your Acces Token>
consumer_secret = <your Consumer Secret> consumer_secret = <your Consumer Secret>
access_secret = <your Access Token Secret> access_secret = <your Access Token Secret>
[mastodon]
server = <mastodon server url>
email = <email address>
password = <password>

View File

@ -42,7 +42,10 @@ gfk_requests <- bind_rows(gfk_requests)
#### Tweeting #### Tweeting
# https://rcrastinate.blogspot.com/2018/05/send-tweets-from-r-very-short.html # You now need a developer account to set up an app, which takes some time.
# Do that here: https://developer.twitter.com/en/apply-for-access.html
# A workaround could be to set up a Mastodon account and then auto-tweet
# using the fantastic https://crossposter.masto.donte.com.br/.
# Read authentication values from ini file # Read authentication values from ini file
# Don't commit real values to git! # Don't commit real values to git!
@ -53,12 +56,16 @@ setup_twitter_oauth(consumer_key = auth$twitter$consumer_key,
consumer_secret = auth$twitter$consumer_secret, consumer_secret = auth$twitter$consumer_secret,
access_secret = auth$twitter$access_secret) access_secret = auth$twitter$access_secret)
# https://rcrastinate.blogspot.com/2018/05/send-tweets-from-r-very-short.html
# After tweeting, write a small text file that has the last timestamp that was tweeted. Use that for grabbing future requests. # After tweeting, write a small text file that has the last timestamp that was tweeted. Use that for grabbing future requests.
#### Tooting
# https://shkspr.mobi/blog/2018/08/easy-guide-to-building-mastodon-bots/
# Might be able to use this natively: https://github.com/ThomasChln/mastodon
library(mastodon)
auth <- read.ini("auth.ini")
mastodon_token <- login(auth$mastodon$server, auth$mastodon$email, auth$mastodon$password)
post_status(mastodon_token, 'I posted this status with the wonderful https://github.com/ThomasChln/mastodon #rstats package.')