twitter-oauth

Twitter::Error::Unauthorized in PostsController#create - Invalid or expired token

Deadly 提交于 2019-12-01 12:37:16
Why does "create" throw me an invalid/expired token error? The users are able to log in just fine (so they are authenticated properly) but when they try to create a post, I get this error. I'm using Omniauth gem (v1.1.4) for authentication and Twitter gem (v4.6.2) for the posting to Twitter. The Omniauth-twitter gem is v0.0.16 if that matters. This is the code that is causing me an error class PostsController < ApplicationController def create Twitter::Client.new.update(@post.content) end end This is part of the user model (user.rb) def twitter unless @twitter_user provider = self

twitter4j no authentication challenges found

拈花ヽ惹草 提交于 2019-12-01 12:28:21
Been trying to use twitter4j to post a tweet for couple days now without luck, what i want to do is for a person to post their new top score on their timeline from the app at the end of a round. Here is my code @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tweetr); Button tweetr = (Button)findViewById(R.id.tweetr); //create a new twitter configuration using user details tweetTwitter = new TwitterFactory().getInstance(); tweetTwitter.setOAuthConsumer(TWIT_KEY, TWIT_SECRET); //create a twitter instance //

Twitter API: Url search for Username

 ̄綄美尐妖づ 提交于 2019-12-01 12:17:44
问题 I have a list of websites where I want to see if they have twitter accounts. I was curious if there is a url search for username in the API, or something of this nature. I've been reading and looking around; however, I've come up short. I would hate to have to do this manually when I could run a function to do the work for me. Would greatly appreciate some feedback on this topic. Good day! 回答1: As explained in the comment above, version 1 of the twitter API is deprecated and will soon be

twitter4j no authentication challenges found

▼魔方 西西 提交于 2019-12-01 12:16:18
问题 Been trying to use twitter4j to post a tweet for couple days now without luck, what i want to do is for a person to post their new top score on their timeline from the app at the end of a round. Here is my code @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tweetr); Button tweetr = (Button)findViewById(R.id.tweetr); //create a new twitter configuration using user details tweetTwitter = new TwitterFactory()

Retrieving a Request Token from the Twitter API with Python 3

删除回忆录丶 提交于 2019-12-01 11:04:18
I am attempting to use Python 3 to interface with the Twitter API to return the link for a page that gives me a pin number to use to request access tokens. As detailed here: https://dev.twitter.com/docs/auth/pin-based-authorization Twitter's API responds to me telling me that I have not properly authorized my POST request by returning a 401. My best guess as to why is that I'm not encoding the HMAC signature in base64 correctly. Everything other part of the POST request I generate appears correct based on samples of correct POST requests I have looked at. I have spent several days working on

Get user follower count with 1.1 - 410 Gone

こ雲淡風輕ζ 提交于 2019-12-01 10:28:09
I'm trying to build a 'Follow' button with a vertical followers count above it. I had a solution working until Twitter retired the 1.0 API today and now require an Oauth solution. My question, what is the best, easiest solution for this (preferably JS). Here is the old solution $.getJSON("https://api.twitter.com/1/users/show.json?callback=?&screen_name=twitter", function(data) { $('.here').text(data); }); And the error I'm getting now GET https://api.twitter.com/1/users/show.json?callback=jQuery20205200183007400483_1371012819892&screen_name=twitter&_=1371012819893 410 (Gone) Jimbo Firstly,

Retrieving a Request Token from the Twitter API with Python 3

☆樱花仙子☆ 提交于 2019-12-01 08:48:27
问题 I am attempting to use Python 3 to interface with the Twitter API to return the link for a page that gives me a pin number to use to request access tokens. As detailed here: https://dev.twitter.com/docs/auth/pin-based-authorization Twitter's API responds to me telling me that I have not properly authorized my POST request by returning a 401. My best guess as to why is that I'm not encoding the HMAC signature in base64 correctly. Everything other part of the POST request I generate appears

Get user follower count with 1.1 - 410 Gone

南笙酒味 提交于 2019-12-01 08:25:34
问题 I'm trying to build a 'Follow' button with a vertical followers count above it. I had a solution working until Twitter retired the 1.0 API today and now require an Oauth solution. My question, what is the best, easiest solution for this (preferably JS). Here is the old solution $.getJSON("https://api.twitter.com/1/users/show.json?callback=?&screen_name=twitter", function(data) { $('.here').text(data); }); And the error I'm getting now GET https://api.twitter.com/1/users/show.json?callback

Having multiple Twitter instances with twitter4j library.

江枫思渺然 提交于 2019-12-01 04:45:24
I need to be able to make different Twitter instances with same consumer key and secret but different user level access tokens . I have already obtained the access tokens for 10 users based on consumer credentials of my app by using standard Twitter OAuth Sign In protocol. Now, I want to create a list of Twitter Instances each initialized with a separate Accesstoken . However, I'm not able to do this. My leading cause of confusion is, that, I don't understand how Twitter4j instantiates Twitter instances. I don't understand the difference between TwitterFactory.getSingleton() method and

ROAuth no longer used in favor of httr? [Twitter API]

独自空忆成欢 提交于 2019-12-01 04:15:21
I'm running R Studio on an AWS "Ubuntu Server 12.04.2 LTS" and accessing R Studio via my browser. When I try to authenticate at the Twitter API using the package ROAuth with the code: credential<-OAuthFactory$new(consumerKey="xxxxx", consumerSecret="xxxxx", requestURL="https://api.twitter.com/oauth/request_token", accessURL="https://api.twitter.com/oauth/access_token", authURL="https://api.twitter.com/oauth/authorize") credential$handshake() registerTwitterOAuth(credential) I get an error after registerTwitterOAuth(credential) saying Error in registerTwitterOAuth(credential) : ROAuth is no