-
Notifications
You must be signed in to change notification settings - Fork 0
Home
James Taylor edited this page Jun 27, 2020
·
7 revisions
Welcome to the eastleighmp wiki!
Get today's date
UNTIL=$(date +%F)
Get yesterday's date
SINCE=$(date --date='yesterday' +%F)
Search for day of tweets
twurl -j "/1.1/search/tweets.json?q=(from:pauljholmes)+since:${SINCE}+until:${UNTIL}&result_type=recent&tweet_mode=extended"
Process tweets
jq --raw-output '.statuses[].full_text'
Strip out mentions
sed 's/\B@\([a-zA-Z0-9_]\+\)/\1/g'
Post a tweet
twurl -d 'status=Test tweet using the POST statuses/update endpoint' /1.1/statuses/update.json
Post an oversized tweet (fails!)
twurl -d 'status=Test tweet using the POST statuses/update endpoint. What happens it the tweet is too long????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????' /1.1/statuses/update.json
Post tweets from a file
xargs -I{} twurl -d 'status={}' /1.1/statuses/update.json < tweets.txt