Skip to content
This repository has been archived by the owner. It is now read-only.

Twitter API v1.0 / v1.1 support #264

Open
jeffehobbs opened this Issue Aug 18, 2012 · 194 comments

Comments

Projects
None yet
@jeffehobbs
Copy link

jeffehobbs commented Aug 18, 2012

Needs API key authentication...or maybe not. In light of the new API rules from Twitter, will tweet.js require an API key? The way I'm reading the new rules, it seems like Twitter is going to want to know who we all are, which connotes "API key".

~Jeff

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Aug 18, 2012

To which new rules are you referring? I haven't read of anything.

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Aug 18, 2012

Found what you're referring to. Will read and respond.

@jeffehobbs

This comment has been minimized.

Copy link
Author

jeffehobbs commented Aug 18, 2012

Right. https://dev.twitter.com/blog/changes-coming-to-twitter-api . "required authentication on every API endpoint".

@jeffehobbs

This comment has been minimized.

Copy link
Author

jeffehobbs commented Aug 18, 2012

Also, I could see "Display Requirements" being a PITA.

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Aug 18, 2012

I've tweeted 'em to find out. We're likely to need to make changes, but I'd hope that whatever plumbing they use to support their own widgets could also be used by ours... sigh.

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Aug 31, 2012

No response. Given the general discussion around this topic, I wouldn't say things look good for the future of jquery.tweet.js.

@raideus

This comment has been minimized.

Copy link

raideus commented Oct 9, 2012

This is probably the best place to get answers: https://dev.twitter.com/discussions

Picked up the following tidbit from a Twitter rep:

"There are no client-side only solutions besides what we offer in our Twitter for Websites family of products at this time. If you want to use the API itself, you'll need to use server-side OAuth. If you want to engage with the platform client-side, you'll need to use the Tweet Button, Follow Button, Embeddable Timelines, Embeddable Tweets, the tweet, follow, favorite, and retweet web intents, and their accompanying javascript events. We're still working on this client-side family of products and there may be further enhancements to the API's auth model in the future that would make client-side development more palatable."

Not sure if that is relevant in any way to jQuery Tweet?

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Oct 11, 2012

@bootsz Yes, it suggest that jQuery Tweet will no longer be able to work in its current form. However, if Twitter is providing its own widgets which presumably have unauthenticated access to backend data, it's possible that Tweet can make itself look like the official widgets and continue to access that same data.

@raideus

This comment has been minimized.

Copy link

raideus commented Oct 11, 2012

Got it. In terms of Tweet "making itself look like the official widgets", any idea how that would be accomplished? I've played around with their new widget a bit and it doesn't seem like they allow hardly any customization from the front-end.

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Oct 11, 2012

@bootsz I just meant from a network point of view -- while the appearance of Tweet wouldn't be identical, it could perhaps be made to make network requests in a manner indistinguishable from the official widget. However, it might still be in violation of the UX guidelines.

@danielkorte

This comment has been minimized.

Copy link

danielkorte commented Oct 18, 2012

So just for clarity's sake, right now at it's current state, jquery.tweet.js would not be a solution if say a large chunk of your site's visitors are visiting from the same IP address where rate limiting would occur very often (and very quickly)?

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Oct 19, 2012

@danielkorte Correct. But neither would Twitter's official widgets be a solution, for the same reason. At least currently. It's unclear what the situation will be with rate limiting after the unauthenticated 1.0 API is disabled.

@StanScates

This comment has been minimized.

Copy link

StanScates commented Feb 21, 2013

Howdy,
I'm rather fond of jquery.tweet.js, so due to the impending deprecation of Twitter API v1.0, I created a simple OAuth / caching layer designed to interface with a slightly modified version of jquery.tweet.js. Set up a Twitter App for your feed, use the customized jquery.tweet.js provided and plug your OAuth credentials into the index.php file included.

Hopefully someone will find this useful. I'm converting all of our production sites which currently use jquery.tweet.js to use this henceforth.

https://github.com/StanScates/Tweet.js-Mod

Feel free to contact me with questions/comments.
Thanks
-Stan

@raideus

This comment has been minimized.

Copy link

raideus commented Feb 21, 2013

Stan, THANK YOU for this! Looking forward to trying it out.

@StanScates

This comment has been minimized.

Copy link

StanScates commented Feb 21, 2013

Let me know how it goes 😺

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Feb 22, 2013

Hi Stan, that's neat! I'll have a think about how/whether to merge some of that back into this main repo. (Since you didn't start by forking this repo it's not easy to see what changes you've made to tweet.js, but I'm guessing it's limited to the build_api_url function.)

You'd have to be careful that other people didn't point scripts etc at your endpoint -- it'd be very easy to exhaust your twitter credentials' request quota.

-Steve

@StanScates

This comment has been minimized.

Copy link

StanScates commented Feb 22, 2013

Hey Steve,
I've just rolled out v1.3, I've made several changes to jquery.tweet.js (feel free to take a look, I would highly value any input you may have), I would certainly be open to forking your repository but I didn't want to jump the gun since this introduces a whole new layer of complexity to your excellent plugin and I didn't want to pollute its simplicity (yet). Please send me an email if you wish and we can discuss how/whether you'd like to package them.

To your second point, although it is theoretically possible, I feel that the effort involved in order to circumvent Same Origin Policy restrictions makes that an unlikely scenario. With that said, I do highly recommend the caching feature, it's enabled by default and very simple.

I very much appreciate your input.

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Feb 24, 2013

Hi @Mandooox, please file related issues on tweet.js-mod rather than here.

@mohamdio

This comment has been minimized.

Copy link

mohamdio commented Feb 24, 2013

hi @purcell , really sorry for that , okay i will delete this comment

but about your plugin , are you will update it or what can we do for [ API 1.1 ] :( ?

and other ask :
when search about new API , i found that should any user will use plugin should Create new APP to can use the plugin after update by Stan ... are that right ...?

thanks again for your great work in this plugin.

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Feb 24, 2013

@Mandooox As discussed earlier in this issue, it's not yet clear whether it will be possible to keep tweet.js working after the old API is disabled. For now, it's still (mostly) working fine.

After the old API is disabled, Twitter will still continue to supply their own (unauthenticated) official tweet widgets, so in theory it would still be possible for tweet.js to use whatever API those official widgets use.

-Steve

@mohamdio

This comment has been minimized.

Copy link

mohamdio commented Feb 24, 2013

okay , really i'm not happy with this new API :( , your plugin was perfect and easy to use , and i hope it will be still working..... thanks

@petenorris

This comment has been minimized.

Copy link

petenorris commented Mar 1, 2013

Not being a developer, I'm still unsure if seaofclouds twitter feed is going to work or not. Is there no way to test with the new API1.1? I predict a raft of people who have implemented into their site who have no idea about the v1.0 switch off (Tuesday 5th?), will suddenly inundate you with questions :( (like this one ;)

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Mar 1, 2013

@petenorris To be clear, tweet.js will not work with the Twitter 1.1 API, because that API requires the use of authentication, and nobody with any sense will put his API authentication key inside a web page so that a widget can use it. So testing with the new API is not a concern.

However, Twitter has its own embeddable widgets, which do not require authentication keys, so it may be possible to reverse-engineer those and make tweet.js mimic the requests they make. This requires a chunk of work which I have not undertaken (so far) because it has been neither urgent nor funded. Note that tweet.js may still fall foul of the user interface guidelines, and therefore not be permitted to use the API.

It's extremely unfortunate that Twitter has declared war on API clients like this.

@petenorris

This comment has been minimized.

Copy link

petenorris commented Mar 1, 2013

Thanks. I really do appreciate your reply and the work to build this in the first place. My client is rather large and I couldn't use the native twitter widget as it's got a minimum height of 300px (and didn't fit the design!).
I have applied stanScates (thanks Stan) to our test version of the site, and its working fine on the test site - fingers crossed for Tuesday!

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Mar 1, 2013

I am also considering building a kind of "proxy" site, which would allow you to enter your Twitter auth details, and then it would sit between tweet.js and the Twitter 1.1 API, similarly to Stan's solution. If there's enough interest then I'll build such a thing, probably payable on a cheap monthly subscription basis.

@bbajohr

This comment has been minimized.

Copy link

bbajohr commented Aug 4, 2013

Please be advised that I will be out of the office until Monday August 12th..

In my absence please contact Oliver Pacheco at opacheco@yfactor.com

Thank You

Brian Bajohr

@jkupczak

This comment has been minimized.

Copy link

jkupczak commented Aug 4, 2013

Hi all,

I've read through this thread to see if there's a solution to this Twitter API issue. The Tweet.js-mod (https://github.com/StanScates/Tweet.js-Mod) by Stan Scates seemed to be the way to go, unless I'm not mistaken. I've used Stan's code on my site and I've almost got it working.

The tweets load, but never show up in the source code! I'm scratching my head on this one.

Here's an isolated page with Tweet.js: http://hypedance.co/blah.php

You'll see a bunch of tweets show up on your screen in Google Chrome. But if you inspect the page you won't find any of them in there. Just the "loading..." text.

Load the same page in Firefox and you don't see any tweets. But if you refresh often enough, you'll see all the same tweets from Chrome for a nanosecond.

I'm not getting any javascript errors.

What in the heck is going on?

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Aug 5, 2013

@jimmykup Please file an issue with Stan's project, not this one. :-)

@andresmgf

This comment has been minimized.

Copy link

andresmgf commented Aug 9, 2013

Hi guys, I need help !!!

I'm using the .net 2.0 version on my project and it works perfect on my local machine, but in production I'm getting "loading tweets".

Same tweeter.config, same jquery call, same web.config.

Can you help me?

PS.: My web application is running on a godaddy domain.

@johnpscott

This comment has been minimized.

Copy link

johnpscott commented Aug 9, 2013

@andresmgf
Have you set up the allowed domain property correctly in twitterproxy.config.

What is the url of your page?

Scotty

Sent from my Windows Phone


From: andresmgfmailto:notifications@github.com
Sent: ‎09/‎08/‎2013 03:48
To: seaofclouds/tweetmailto:tweet@noreply.github.com
Cc: John Scottmailto:johnpscott@live.co.uk
Subject: Re: [tweet] Twitter API v1.0 / v1.1 support (#264)

Hi guys, I need help !!!

I'm using the .net 2.0 version on my project and it works perfect on my local machine, but in production I'm getting "loading tweets".

Same tweeter.config, same jquery call, same web.config.

Can you help me?

PS.: My web application is running on a godaddy domain.


Reply to this email directly or view it on GitHub:
#264 (comment)

@andresmgf

This comment has been minimized.

Copy link

andresmgf commented Aug 9, 2013

Scotty,

Thanks in advance for your response.

I have tried with many options but nothing...

<twitterOAuthConfiguration
allowedDomain="www.elmejordelacancha.com" (also elmejordelacancha.com -without www-)
consumerKey="my consumer key"
consumerSecret="my consumerSecret"
cacheInterval="900" />

My site is in production right now but requires app login. If you want to see it, let me know your email and I will give you a user for that.

Thanks again

@patracompany

This comment has been minimized.

Copy link

patracompany commented Aug 9, 2013

I am a newbie at this and I have tried to implement Stans The Tweet.js-mod (https://github.com/StanScates/Tweet.js-Mod) but I am having troubles. Can anyone help? http://originalcomputing.com/ocweb/patracompanyCMP/standalone/index.php

@phelgren

This comment has been minimized.

Copy link

phelgren commented Aug 10, 2013

I am one of those caught short by the API change (my app is used twice a year at conferences). I took the approach of using twitter4j in a servlet to return the tweet data but I would like to use tweet.js to format the data to the moble app. I could just do all the formatting myself but I was hoping I could hook up build_api_url to return the raw json from twitter4j and then use extract_template_data to get and format the json. But looking at the properties on the json returned, there doesn't seem to be a match in format. Has anyone used twitter4j on the backend? Any suggestions on how it might be accomplished? Perhaps twitter4j uses it's own formatted properties on the twitter data?

@Tsukimara

This comment has been minimized.

Copy link

Tsukimara commented Sep 12, 2013

Steve, is there any simple way to get the twitter ticker to animate horizontally from right to left? I am not a Jquery/java hero and ive dug throught the code, but i can't seem to figure it out.

@purcell

This comment has been minimized.

Copy link
Collaborator

purcell commented Sep 12, 2013

Sorry, I don't have a handy example of horizontal scrolling. It's probably a bit fiddly, as the

    's children will be arranged vertically by default, and the vertical scrolling example simply scrolls them inside an "overflow: hidden" div.

@Tsukimara

This comment has been minimized.

Copy link

Tsukimara commented Sep 12, 2013

Thanks anyway.

@TineHorvat

This comment has been minimized.

Copy link

TineHorvat commented Sep 12, 2013

@Tsukimara I've played around and this is what I came with.
Maybe not the best solution, but it works for me ;)
$("#TwitterTicker").tweet({
twitter_api_proxy_url: "/twitterproxy.ashx",
username: "MythBusters",
page: 1,
avatar_size: 29,
count: 20,
loading_text: "Loading ..."
}).bind("loaded", function() {
var twiti = $(this).find(".tweet_list");
var len = twiti.find("li").width() * twiti.children().length;
twiti.css("width", len);
var l = 0;
var ticker = function() {
setTimeout(function() {
var left = twiti.position().left;
var wid = twiti.find("li").width();
l -= parseInt(wid);
if (l <= (len * -1)) l = 0;
twiti.animate({left: l}, 1000);
ticker();
}, 10000);
};
ticker();
});

hope this helps you somehow :)

edit (add the css):
.TwitterPane{height:35px; overflow:hidden;}
.TwitterPane a.TwitterLink:link, .TwitterPane a.TwitterLink:visited{float:left; display:block; width:35px; height:35px; background:url(sprite.png) no-repeat -37px -255px;}
.TwitterPane a.TwitterLink:hover, .TwitterPane a.TwitterLink:active{background-position:left -255px;}
#TwitterTicker{float:left; width:905px; background:url(sprite.png) no-repeat -73px -255px;}
#TwitterTicker{height: 35px; overflow-x: hidden; position: relative;}
#TwitterTicker ul.tweet_list {position: absolute; -webkit-border-radius: 0; -moz-border-radius: 0;border-radius: 0; height:35px}
#TwitterTicker ul.tweet_list li {height: 35px; float: left; width: 906px;}
.tweet, .Twitterquery { font-size:11px; font-family:Arial, Helvetica, sans-serif; color: #585b5d; }
.tweet_list{list-style: none; margin: 0; padding: 0; overflow-y: hidden; }
.tweet_list li{overflow-y:hidden; overflow-x: hidden; height:35px; line-height:35px; list-style-type: none;}
.tweet_list li a{color: #585b5d; }
.tweet_list .tweet_even{}
.tweet_list .tweet_avatar{padding-right: .5em; float: left; margin-left:4px; }
.tweet_list .tweet_avatar img {vertical-align: middle; }

@Tsukimara

This comment has been minimized.

Copy link

Tsukimara commented Sep 12, 2013

@TineHorvat i tried your solution, its not working for me but i might be doing something wrong.

the code i currently use is:

    jQuery(function($){
    $("#ticker").tweet({
    username: "Erik_Sherman",
    page: 1,
    avatar_size: 32,
    count: 5,
    loading_text: "loading ..."
    })
    });

    $(document).ready(function() {

    var ul = $(this).find(".tweet_list");
    var ticker = function() {
    setTimeout(function() {
    var top = ul.position().top;
    var h = ul.height();
    var incr = (h / ul.children().length);
    var newTop = top - incr;
    if (h + newTop <= 0) newTop = 0;
    ul.animate( {top: newTop}, 500 );
    ticker();
    }, 6000);
    };
    ticker();
    $('#ticker a').attr('target','_blank');
    });

as seen on www.eriksherman.nl

@Tsukimara

This comment has been minimized.

Copy link

Tsukimara commented Sep 12, 2013

I got it to work to animate it horizontally thnx to @TineHorvat, but it didnt work perfectly, it looked like it kept adding extra padding on the right side of the avatar per tweet.

Anyhow, i was wondering if it was possible to use this version:

jQuery(function($){
$(".tweet").tweet({
join_text: "auto",
username: "seaofclouds",
avatar_size: 48,
count: 3,
auto_join_text_default: " we said, ",
auto_join_text_ed: " we ",
auto_join_text_ing: " we were ",
auto_join_text_reply: " we replied ",
auto_join_text_url: " we were checking out ",
loading_text: "loading tweets..."
});
});

But that it showed the tweets horizontal. and that instead of the Li tweet first tweet even etc be placed inside a div called

  • etc.

    i hope i still make any sense, javascript / jquery is such a pain to me.

  • @glenfoster

    This comment has been minimized.

    Copy link

    glenfoster commented Sep 13, 2013

    Hi, I'm using Johns amazing .net solution and it's all working fine until I try to move the handler file out of the root. I've updated the jquery to reflect the new path and it's still being called but the tweets just aren't being loaded! Because of some strange restrictions on the site I'm developing I'm unable to put things in the root folder. Does anyone have any suggestions of how I can get round this?
    Thanks,
    Glen

    @johnpscott

    This comment has been minimized.

    Copy link

    johnpscott commented Sep 13, 2013

    Hi Glen,

    I have a fix but i don't have time to do a complete build and upload new version. If you email me at johnpscott at live dot co dot uk i will send you the dll and instructions. Which version of asp.net are you using?

    Cheers

    Scotty

    Sent from my Windows Phone


    From: glenfostermailto:notifications@github.com
    Sent: ‎13/‎09/‎2013 17:19
    To: seaofclouds/tweetmailto:tweet@noreply.github.com
    Cc: John Scottmailto:johnpscott@live.co.uk
    Subject: Re: [tweet] Twitter API v1.0 / v1.1 support (#264)

    Hi, I'm using Johns amazing .net solution and it's all working fine until I try to move the handler file out of the root. I've updated the jquery to reflect the new path and it's still being called but the tweets just aren't being loaded! Because of some strange restrictions on the site I'm developing I'm unable to put things in the root folder. Does anyone have any suggestions of how I can get round this?
    Thanks,
    Glen


    Reply to this email directly or view it on GitHub:
    #264 (comment)

    @abdulqadar

    This comment has been minimized.

    Copy link

    abdulqadar commented Sep 27, 2013

    Hi Scotty,

    Can you please share the ASP.NET ashx based solution. Sorry, if I was unable to find in above comments.

    I want to give it a try. you can drop me at abdul dot qadar at gmail dot com.

    Cheers,
    Abdul

    @timacheson

    This comment has been minimized.

    Copy link

    timacheson commented Dec 6, 2013

    The best solution for client-side Twitter API implementation is a simple proxy wrapper around the API. This will make your existing code or plugin work again with the new Twitter API.

    I've written one for .NET/C#:

    http://www.timacheson.com/Blog/2013/jul/twitter_api_proxy

    I've also written one for classic ASP which can easily be tw

    Blockquote
    eaked to work in similar scripts e.g. PHP, or indeed VB, etc:

    http://www.timacheson.com/Blog/2013/jun/asptwitter

    Alternatively could just use an existing proxy service like YQL.

    @TineHorvat

    This comment has been minimized.

    Copy link

    TineHorvat commented Dec 10, 2013

    Did Twitter changed something again? Was using the @johnpscott asp proxy and was working wonderful until yesterday. Today, I can't get any of my tweets to display, stuck at the Loading... Checked with firebug: http://prntscr.com/2a2x7h this is what I get back form response
    Anyone knows if there were some new changes to Twitter api?

    @johnpscott

    This comment has been minimized.

    Copy link

    johnpscott commented Dec 10, 2013

    Is it an allowed domain problem? If you set www.dom.com and access dom.com it would fail. Best to set it as dom.com. Just a hunch. My sites are working fine.

    Cheers

    Scotty

    Sent from my Windows Phone


    From: Wilffmailto:notifications@github.com
    Sent: ‎10/‎12/‎2013 13:08
    To: seaofclouds/tweetmailto:tweet@noreply.github.com
    Cc: John Scottmailto:johnpscott@live.co.uk
    Subject: Re: [tweet] Twitter API v1.0 / v1.1 support (#264)

    Did Twitter changed something again? Was using the @johnpscott asp proxy and was working wonderful until yesterday. Today, I can't get any of my tweets to display, stuck at the Loading... Checked with firebug: http://prntscr.com/2a2x7h this is what I get back form response
    Anyone knows if there were some new changes to Twitter api?


    Reply to this email directly or view it on GitHub:
    #264 (comment)

    @TineHorvat

    This comment has been minimized.

    Copy link

    TineHorvat commented Dec 10, 2013

    Hey Scotty, you mean in the twitterproxy.config or on twitter app?
    I've checked and its without the www. prefix

    @Tsukimara

    This comment has been minimized.

    Copy link

    Tsukimara commented Dec 10, 2013

    when trying to acces my site, mitmedia.nl i am now getting:

    Warning: Cannot modify header information - headers already sent by (output started at /home/mitmedia/domains/mitmedia.nl/public_html/wp-content/themes/MKB5/functions.php:116) in /home/mitmedia/domains/mitmedia.nl/public_html/wp-includes/pluggable.php on line 899

    Was working perfectly before

    @Tsukimara

    This comment has been minimized.

    Copy link

    Tsukimara commented Dec 19, 2013

    Any fix for this yet? I have still not managed to find out how to fix this.

    @j4ckielord

    This comment has been minimized.

    Copy link

    j4ckielord commented Jan 20, 2014

    You can use this WordPress Plugin: http://www.designwall.com/wordpress/plugin/dw-twitter/

    @richiebee

    This comment has been minimized.

    Copy link

    richiebee commented Jan 22, 2014

    hey if it works in in WordPress why not iframe into site?

    @Tsukimara

    This comment has been minimized.

    Copy link

    Tsukimara commented Jan 22, 2014

    I rather see this issue fixed. Wordpress plugins are the worst.

    Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
    You can’t perform that action at this time.