twitter

Post photo to Twitter using Curl and Windows command line

人盡茶涼 提交于 2021-01-29 12:28:18
问题 I am using Curl to post to the Twitter API via the Windows command line. I've already generated the oAuth headers and can post a tweet without a photo using: curl -k -X POST "https://api.twitter.com/1.1/statuses/update.json" -d "status=Test" -H "Authorization: OAuth oauth_consumer_key=\"xxxxxxxxxxxxxxxxxxx\", oauth_nonce=\"xxxxxxxxxxxxxxxxxxxxxxx\", oauth_signature=\"xxxxxxxxxxxxxxxxxxx\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"xxxxxxxxxx\", oauth_token=\"xxxxxxxxxxxxxxxxx\",

Twitter user_timeline not returning enough tweets

无人久伴 提交于 2021-01-29 09:51:22
问题 I'm currently using the GET statuses/user_timeline twitter API in python to retrieve tweets, It says in the docs This method can only return up to 3,200 of a user’s most recent Tweets however when i run it, it only returns 100-150. How do i get it to return more tweets than it is already? Thanks in advance 回答1: You'll have to write code to work with timelines. Twitter's Working with timelines documentation has a discussion of how and why Twitter timelines work the way they do. Essentially,

'Could not authenticate you' when using search_tweets function in rtweet package?

隐身守侯 提交于 2021-01-29 06:54:41
问题 I encountered another problem when using rTweet. Here is my code. consumer_key <-"*****" consumer_secret <- "*****" access_token<-"*****" access_secret <- "*****" my_app <- '*****' twitter_tokens <- rtweet::create_token(app = my_app, consumer_key = consumer_key, consumer_secret = consumer_secret, access_token = access_token, access_secret = access_secret) #install_github('Stat',force = T) devtools::install_github('mkearney/rtweet') #install.packages('rtweet') library(rtweet)#packageVersion(

Get users a Twitter user is following

谁都会走 提交于 2021-01-28 21:28:07
问题 I am using the Twitter API to create a web application. However, I would like to be able to get a list of users that a specific user is following. I have looked at the documentation and I have not been able to find how to do this. For example, I might be trying to get the users that baconman is following. How can I do this using the Twitter API? 回答1: <?php $screen_name = 'baconman'; $url = 'https://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name='.$screen_name; $list = curl($url,

Ignoring Retweets When Streaming Twitter Tweets

僤鯓⒐⒋嵵緔 提交于 2021-01-28 08:14:52
问题 I am trying to run a simple script that will stream live Tweets. Several attempts to filter out retweets have been unsuccessful. I still get manual retweets (with the text "RT @") in my stream. I've tried other methods including link and link. As I am learning, my code is very similar to the following: link What can I do to ignore retweets? Here is a snippet of my code: class StreamListener(tweepy.StreamListener): def on_status(self, status): if (status.retweeted) and ('RT @' not in status

Twitter API: media/upload 400 Bad Request: media type unrecognized

核能气质少年 提交于 2021-01-28 06:22:43
问题 So I've got a website where a user uploads an image file (I've been testing with a 113KB PNG file). After hitting the submit button, the image data gets encoded into base64 and then is sent to a node.js server hosted on heroku in a JSON in the body of the POST request. The server then takes the image data and parses the JSON. Then, I make a POST from the heroku server to the media/upload endpoint using the node module, twitter . I've tried using it to post a regular status which worked, so it

Twython with 140 character limitation of twitter

折月煮酒 提交于 2021-01-28 05:43:19
问题 I am trying to search in twitter using Tython, but it seems that the library has a limitation on 140 characters. With the new feature of python, i.e. 280 characters length, what can one do? 回答1: This is not a limitation of Twython. The Twitter API by default returns the old 140-character limited tweet. In order to see the newer extended tweet you just need to supply this parameter to your search query: tweet_mode=extended Then, you will find the 280-character extended tweet in the full_text

Tweepy Get Tweets in reply to a particular tweet

≡放荡痞女 提交于 2021-01-27 17:44:22
问题 So I've been doing a lot of work with Tweepy and Twitter data mining, and one of the things I want to do is to be able to get all Tweets that are replies to a particular Tweet. I've seen the Search api, but I'm not sure how to use it nor how to search specifically for Tweets in reply to a specific Tweet. Anyone have any ideas? Thanks all. 回答1: user_name = "@nameofuser" replies = tweepy.Cursor(api.search, q='to:{}'.format(user_name), since_id=tweet_id, tweet_mode='extended').items() while True

Fetch Image & External URL from Tweets with statuses/user_timeline API

只愿长相守 提交于 2021-01-27 10:54:34
问题 I wish to extract value for External URL present in the Tweet. Plus the generated Thumbnail of that URL. Example Tweet: http://prntscr.com/ogdqey https://twitter.com/JarirBookstore/status/1151506848387870720 Output from Twitter statuses/user_timeline API - { "created_at": "Wed Jul 17 15:00:01 +0000 2019", "id": 1151506848387870720, "id_str": "1151506848387870720", "full_text": "عروض #صيف_هواوي على أجهزة التابلت والميت بوك المختلفة \nالعرض ساري الى 21 يوليو", "truncated": false, "display_text

Spring Boot OAuth 2.0 and OAuth 1.0a clients in same app

佐手、 提交于 2021-01-27 06:46:24
问题 Anybody have experience using OAuth2.0 and OAuth 1.0a client authentication in same Spring Boot application? Having some trouble getting the 2 working in the same system. Our use case - User can connect multiple 3rd party accounts to our web app. This connection happens via OAuth, and in the case of 3rd party services that use OAuth 2.0, we have no problems. Now we want to add Twitter as a supported connection, with their OAuth 1.0a path we are having a lot of trouble getting this to work.