Created
February 7, 2023 07:10
-
-
Save dewomser/8f83d2d3ed9563141ce12d6f1f452175 to your computer and use it in GitHub Desktop.
Retweet Twitter things with API 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#curl --request GET "https://api.twitter.com/2/tweets/search/recent?query=context%3A65.852262932607926273%20-is%3Aretweet%20has%3Aimages%20lang%3Aja" -H "Authorization: Bearer $BEARER_TOKEN" | jq . | grep \"id\": | sed s/\"id\"://g | sed s/" "//g | sed s/\"//g | sed s/,//g >katzenbilder.txt | |
#curl --request GET "https://api.twitter.com/2/tweets/search/recent?query=context%3A65.852262932607926273%20-is%3Aretweet%20has%3Aimages%20lang%3Ade" -H "Authorization: Bearer $BEARER_TOKEN" | jq . | grep \"id\": | sed s/\"id\"://g | sed s/" "//g | sed s/\"//g | sed s/,//g >katzenbilder.txt | |
#curl --request GET "https://api.twitter.com/2/tweets/search/recent?query=linux%20-is%3Aretweet%20lang%3Ade" -H "Authorization: Bearer $BEARER_TOKEN" | jq . | grep \"id\": | sed s/\"id\"://g | sed s/" "//g | sed s/\"//g | sed s/,//g >katzenbilder.txt | |
#curl --request GET "https://api.twitter.com/2/tweets/search/recent?query=chat%20context%3A65.852262932607926273%20%20-is%3Aretweet%20has%3Aimages%20lang%3Afr" -H "Authorization: Bearer $BEARER_TOKEN" | jq . | grep \"id\": | sed s/\"id\"://g | sed s/" "//g | sed s/\"//g | sed s/,//g >katzenbilder.txt | |
curl --request GET "https://api.twitter.com/2/tweets/search/recent?query=cat%20context%3A65.852262932607926273%20%20-is%3Aretweet%20has%3Aimages%20lang%3Azh" -H "Authorization: Bearer $BEARER_TOKEN" | jq . | grep \"id\": | sed s/\"id\"://g | sed s/" "//g | sed s/\"//g | sed s/,//g >katzenbilder.txt | |
#arduino 131.1361684423754665994 | |
#raspi 131.1361692529083621376 | |
#curl --request GET "https://api.twitter.com/2/tweets/search/recent?query=raspberry%20context%3A131.1361692529083621376%20-is%3Aretweet%20has%3Aimages%20" -H "Authorization: Bearer $BEARER_TOKEN" | jq . | grep \"id\": | sed s/\"id\"://g | sed s/" "//g | sed s/\"//g | sed s/,//g >katzenbilder.txt | |
#Mikrocontroller | |
#curl --request GET "https://api.twitter.com/2/tweets/search/recent?query=context%3A131.1361716950590623744%20-is%3Aretweet%20has%3Aimages%20" -H "Authorization: Bearer $BEARER_TOKEN" | jq . | grep \"id\": | sed s/\"id\"://g | sed s/" "//g | sed s/\"//g | sed s/,//g >katzenbilder.txt | |
#mastodon | |
#curl --request GET "https://api.twitter.com/2/tweets/search/recent?query=mastodon%20context%3A131.1196446161223028736%20-is%3Aretweet%20has%3Aimages%20lang%3Ade" -H "Authorization: Bearer $BEARER_TOKEN" | jq . | grep \"id\": | sed s/\"id\"://g | sed s/" "//g | sed s/\"//g | sed s/,//g >katzenbilder.txt | |
while read line | |
do | |
date=$(date) | |
a="Noch mehr chinesische #Katzenfotos. Ich wechsele nach Mastodon @dewomser@social.tchncs.de . $date: https://twitter.com/dewomser/status/$line" | |
twurl -u dewomser -X POST "/1.1/statuses/update.json?status=$a" | |
echo $a | |
sleep 15 | |
done < katzenbilder.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.twitter.com/en/docs/tutorials/step-by-step-guide-to-making-your-first-request-to-the-twitter-api-v2
https://medium.com/@SamSchmir/a-guide-to-the-twitter-api-and-twurl-8711466a0635
https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query
https://tweet-entity-extractor.glitch.me