seaofclouds / tweet Goto Github PK
View Code? Open in Web Editor NEWput twitter on your website with tweet, an unobtrusive javascript plugin for jquery
Home Page: http://tweet.seaofclouds.com
License: MIT License
put twitter on your website with tweet, an unobtrusive javascript plugin for jquery
Home Page: http://tweet.seaofclouds.com
License: MIT License
First off, thanks for this excellent jQuery plug-in.
I am new to jQuery and although I have it working on my site without any problems at all using predetermined Twitter usernames, I am trying to add some extra incentive for my news posters.
I have a dynamic PHP page displaying user submitted news and lets say the users username is held in a PHP var $username and the news title is helf in another PHP variable $title - how could I use this plug-in to display Tweets based on those variables for the query?
In essence, I need something along the lines of
$("#userandquery").tweet({
count: 4,
query: "from:$username&phrase=$title",
loading_text: "searching twitter..."
});
Any help from anyone would be gretly appreciated.
Is it possible auto refresh Tweet every x seconds?
thanks!
Setting the alt is great, but it's not shown by all browsers (and is not actually supposed to be shown). Setting the title, in addition to only the name, means that people can mouse over the avatar and see the username.
Thanks for the great script, everything works and displays great. However I sometimes cant keep up with posting tweets and would like to hide the "tweet" class if there are no tweets in the last 7 days. I would like to hide the tweet class but don't know where in the script I could do this. The function I want to run is:
$(".tweet").hide();
Any suggestions. Thanks for your help.
Jcostanza
I want to use the hashtag #gen2010. When I use it with the # sign, the script doesn't show anything.
The reason this is an issue is because there is a user that has that username, and the organization I am working for is using the hashtag #gen2010. They don't want her tweets to show up.
Any solution?
Hi seaofclouds
First of all, thanks for providing this great script :)
After implementing it on my site, I noticed there's an issue - some of my tweets appear and some doesn't. I've been trying to notice a pattern but unfortunately I wasn't able to isolate the fault.
If you check out my site here http://bit.ly/7ErxCi and compare it to my twitter page at http://bit.ly/6dNi1t, you would notice the problem.
I hope you could help to look into this, or at least point me in the right direction. Thanks!
Cheers,
Damian
For some odd reason, my twitter user name will not work. I've tried some of my friends user names, and they all work fine.
my user name is februaryson
any suggestions?
The IEs can't handle the date format returned by Twitter. You need to change it into something more standard before handing it to Date.parse()
. Modify the first line of relative_time()
and make it these two instead:
var reformatted_time_value = time_value.replace(/(\+\S+) (.*)/, '$2 $1');
var parsed_date = Date.parse(reformatted_time_value);
I tested this with success in IE 6-7-8, Google Chrome and Firefox 3. This code is adapted from Brenen's comment at http://www.quietless.com/kitchen/format-twitter-created_at-date-with-javascript/.
I'd like to not have tweets show up in the list if they begin with "@username." Is that hard to do?
What is the best way of searching by Phrase with your wonderful script?
I know the default syntax is:
query: "term",
But with the twitter API I would use search for "Term" but because of the cod of tweet, if I put in " either side of the phrase, it caused a PHP error because of the "" both before and after the term.
It would be great to be able to have the ability to show tweets for a list i've created. for instance @user/sports, would show all the tweets from that list. I've been using this plug in for a while, and this is the only limitation I can see!
currently, relative time (about 1 minute ago) is the default, but it may be preferred to say (Wednesday at 2:28pm). I'd like to implement this as a feature using strftime: http://cheat.errtheblog.com/s/strftime/
When the hash tag is the first item within a tweet the REGEX code doesn't replace it with the hyperlink.
The code with the linkHash function on line 42
var regexp = / [#]+([A-Za-z0-9-_]+)/gi;
needs to be replaced so that there is no space after the first "/"
var regexp = /[#]+([A-Za-z0-9-_]+)/gi;
Great library BTW.
Mark
Okay. So I'm not sure if I'm supposed to post support issues here. But I had my tweets running on my website for a while and then they just disappeared one day.
The tweets are supposed to load under the main navigation.
And also on this page: http://carolinaandhuy.com/en/contact.html
You can see that it says "Loading tweets..." But nothing happens.
If anybody can have a look or point me in the right place to post this question it would be much appreciated. Can anyone tell me what happened? Because I haven't made any changes to the site in months.
Anyways, Thanks.
Kev
Just reporting a bug with the time thing. Worked fine in older versions!
Could anybody explain the move to the actual Twitter API? It's limited to 150 request per username per hour. This isn't working out considering we're running websites that could have more then 150 users per hour!!
Perhaps an option to use the Search API would be nice?
I didn't want to show the timestamp and so I had to manually hack the plugin to change that. Seems like an easy and obvious option to add.
Hi guys, i am having a problem where if i add a retweet it is counted towards the tweets in my site but obviously doesnt show... i dont mind that it doesnt show and i understand why thats the case... but is there a way to stop retweets being counted?
An example is i have a count of 5, if the last 2 tweets were retweets my site only shows 3 tweets.... is that right and normal? or is there a way around?
Any help would be much appreciated.
unless I'm doing something wrong, seems as though twitter updates that contain "(@_________)" are processed by tweet as "(@jquery1)"
Hi seaofclouds - I like tweet very much!
I was wondering if there was some easy way to exclude certain tweets? This is the situation....
Blog sends posts via RSS/feedburner automatically to Twitter. All posts to Twitter are prefixed with the same text every time (for example WQ:). In the sidebar of Blog we have tweet bringing in tweets. But having them show up in the sidebar again is pretty redundant.
What I would like to do is have tweet not display the tweets with WQ: - possible?
Cheers
gomi
Hello,
I hate having to fix things for Microsoft, but unfortunately my boss would not update her IE7 (at least is not 6!) so everything I do must work on IE7. Using jQuery 1.4, everything is fine in Firefox, Safari, Chrome, Opera, but in one page IE7 only shows 2 of the 3 that are supposed to show and in another page only 1 of the 10 that show everywhere else. I really like your plugin, am I doing something wrong?
Hi, I'm about to use your plugin for displaying a twitter feed in a website and when making some tests I noticed that it was displaying an heart in a tinyurl for the following tweet:
39 minutes ago @TheGRAMMYs David Archuleta's new #Christmas from the Heart album is amazing, snippets won't do them justice:) http://tinyurl.com/♥gnr
This is an issue with the regex, you are using [< ;]+[3] for matching the "<3" but what that it's doing is matching any string containing those characters followed by a "3" so the "lt3" in the following url is also matched: "http://tinyurl.com/lt3gnr"
I replaced that regex with (< ;)+[3] this means that it will match the group of characters and not any of those characters, I test this doing a search for "<3" and all of those where successfully changed for a heart also "http://tinyurl.com/lt3gnr" was not modified this time.
Great plugin btw!
Javier Reartes
Awesome widget! Just one thing I noticed: when I use it with a query and without a username, it still inserts the (default) user into the hashtag link. It should be possible to turn that off, maybe by setting the username to null.
I didn't see any way of doing this, so more of a feature request than an issue.
Sometimes twitter is s...l...o...w.
Does anyone else think it would be nice to have a timeout_text and timeout_time (in seconds) parameter?
Or maybe a timeout method that you could bind to in the same way as loaded?
It could be too much overhead to include a timer in this plugin but maybe someone smarter than me can think of a better way to do it.
Thanks,
-sean
Thanks for a great script. Is it possible to display feeds from multiple lists from the same user or even from multiple lists from different users?
The Twitter account i'm fetching from has the following timeline right now:
retweet
retweet
tweet
tweet
retweet
retweet
tweet
When I set the "count" variable to 1 it will not display any tweets. When I set it to 3 it shows the first tweet. When I set it to 7 it shows the three tweets.
So, for some reason it cancels out the retweets, even if it includes them in the "count".
Does anyone know wether there is an easy fix to this?
I'm not too savvy with Javascript, but I will take a look at the code nontheless, but if anyone has a simple fix I'd be a happy camper.
at http://tweet.seaofclouds.com/
mayhap soe regex snafuage?
It should use the HTTPS if on HTTPS to avoid a browser security warning
Replace:
var url = 'http://search.twitter.com/search.json?&'+query+'&rpp='+s.count+'&callback=?';
With:
var url = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'search.twitter.com/search.json?&'+query+'&rpp='+s.count+'&callback=?';
We have discovered that creating Twitter lists on our account CAN001 interferes with the seaofclouds tweet plugin. The tweet feed was a little wobbly (as in it updated occasionally with random tweets and left some out). But..when the Twitter lists were created the feed update became even more sporadic to the point of not updating the feed with new tweets at all. Once the lists were deleted the feed went back to its usual merry updating. We are wondering if the Twitter API has been updated/changed with enabling lists and this (is as a new version of API) has affected the plugin and perhaps Twitter don't version their API.
Any thoughts welcome..
Ingrid Mason
http://www.collectionsaustralia.net
I use tweet on a bunch of pages at http://www.looktothestars.org/, and noticed that tweet just stopped working in some cases; specifically, the front-page tweet block (at page bottom) works fine, but blocks displaying tweets from an individual twitter user don't work (e.g. http://www.looktothestars.org/celebrity/59-eddie-izzard, page bottom).
And now I see that the examples at http://tweet.seaofclouds.com are also broken. Is it possible that Twitter have changed something upstream to break tweet?
I use this great tool to display tweets from a list and I would like to show a list of all users who are on it. Is there a way to achieve this?
The relative timestamp is neat, but it was taking up too much space in my sidebar. I had to hack the JS to put a short string ("said:") there instead. This should be another option in the configuration.
I have very little space to show tweets on my site. Because of that, I would like to show last 5 tweets, but one by one. Newer first, then the older ones. I suppose it's a very simple trick with tweets the application already get and CSS/Javascript, but I don't have the skills to do it by myself.
Even if this isn't included in this awesome script, at least did anyone find a way to do it?
Thanks in advanced.
Tweet! displays all occurences of the word "awesome" in all uppercase as "AWESOME" even if the original was "Awesome" or "awesome".
Is this a feature, a bug or an easter egg?
Are there possibly other words that act like this?
If this is a known feature it should be somehow documented and able to turn it off or configure the word list.
I was able to go to line 135 and rearrange the items so that it now comes up with the text first followed by the date, but I actually want to move the date to the next line so it shows up under the tweet text.
Is there an easy way to do this?
Thanks,
Tyler
The search api method for twitter only grabs tweets from the last 10 days. So, if you havn't tweeted in a while your tweet widget comes up blank.
If you switch to the user_timeline api method it will grab all the tweets regardless of length of time since last tweet.
This involves changing the url variable to
var url = 'http://twitter.com/status/user_timeline/'+s.username+'.json?count='+s.count+'&callback=?';
and editing the each loop to support the new json format.
I am trying to put tweet into my blog (blogCFC) and it isn't pulling the most current tweets. It is pulling the the 15th and 16th oldest tweets. I am using the code directly off of there website, so I don't understand why that is happening.
When I set the username option to an array the feed doesn't work when I add more than 7 usernames.
Can we please have more documentation on the options? Even just copy/paste the notes in the top of the .js file into your promo page and a wiki page on here.
The script has been working for our public website for a few weeks and now it's suddenly stopped working!
Any ideas?
Thanks
Ben
We're using this for an event, and I'd like to not show a specific username when pulling a hashtag. Any ideas?
I might be missing something, but how do you set links to open in a new window? I am using this in an iframe and need all links to open a new window. Is this possible? Thanks.
So the problem with this plugin is that it relies on a person to post every week or so as Twitter removes your results from the search stream after a certain # of days. If there's no updates it doesn't output anything at all except a blank LI, so you really need to output some text there so it doesn't look completely empty.
I easily hacked it in by just adding a check inside the getJSON function. If length is 0 then I spit out a message like "No recent tweets"
I love the product -- and I'd actually pay to have this done.
Instead of saying, "Posted about 1 hours ago" -- it really needs to be correct and say, "Posted about 1 hour ago" -- this really goes for any usage of a word after a "1"
Please let me know if this is something can be easily fixed -- I'll pay you for your time.
I'm trying to display 11 users, but it seems to be maxing out at 7. Is this a known limitation with the Twitter Search API, or is this something in the way Tweet is written? Is there a way to fix this without having to make multiple API calls and then merging the results?
currently, you have to hack the javascript to change the order of listed tweets. to do so, edit line 135 to your desired order.
in the future, i would like to have a configurable template that allows you to set this order when you load tweet.
Since twitter doesn't completely delete tweets (because they still show in search), the deleted tweets also show up through this script.
Is there a way around this?
//edit
found another twitter.jquery plugin which doesn't use the search function but seems to get it from http://twitter.com/statuses/user_timeline
Here the deleted tweets don't show up.
plugin is here http://coda.co.za/blog/2008/10/26/jquery-plugin-for-twitter
I would like to display the tweets on our website for our clients but the code is only allowing me to pull in 7 usernames. is there a way to pull in more than seven?
this is an example of the code that i have in there currently:
query: "from%3ATestName_01+OR+from%3ATestName_02+OR+from%3ATestName_03+OR+from%3ATestName_04+OR+from%3ATestName_05+OR+from%3ATestName_06+OR+from%3ATestName_07",
if i add an 8th username (not a fake on like the example above) the feed no longer works.
any ideas on how to add more than 7 usernames? thanks in advance!
I'm having some trouble, the tweet(s) display no problem with a single-name username, but when theres an underscore in the user name: like_this - it doesnt work.
Is this something that I have to escape in the on load javascript?
Thank you for your urgent help!
A
Hi, I replied to closed issue on this from a couple of days ago but not sure if it'll be seen.
Have noticed this only appears when using the "username" property, so demos 1 & 5 on your site, thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.