ThinkTwit
ThinkTwit is a Twitter module for Wordpress. ThinkTwit uses the Twitter ATOM API to display recent tweets from one or more Twitter users. It is very simple, yet flexible and easily customised. It can be placed on your Wordpress page simply through drag and drop on the Widgets interface.
ThinkTweet was created due to a lack of fully functional modules that offer the ability to request tweets from more than one user. It was created using a heavily modified version of code written by Anders Moss at Instant Shift with added code changes by Kevin Pajak at kevinpajak.com. Thanks guys, the code has been much appreciated!
Given the code created was so useful, and the lack of modules that did what we required, it was decided to created a plugin so that we can give something back to the community – we sincerely hope that others can benefit from this!
ThinkTwit was originally developed by Stephen Pickett when he was working for Think Consulting Solutions. Think decided to open source the code and now that he has left Stephen has decided to continue to maintain the code.
Features:
- Configure from Widgets settings
- Multiple instances can be deployed (like other widgets)
- JavaScript is not required (unless no-caching is activated)
- Can specify multiple usernames
- Can specify maximum number of tweets
- Easy to configure and customise (through CSS)
- Supports no-caching, to prevent caching of tweets by caching engines such as WP Super Cache
- Supports CURL as an alternative to access the Twitter API if URL file-access is disabled
Requirements/Restrictions:
- Works with Wordpress 2.8.6 to 2.9.2, not tested with other versions
- Must be installed using the widgets sidebar
Installation
- Unpack the zip file and upload the `thinktwit` folder to the `/wp-content/plugins/` directory, or download through the `Plugins` menu in WordPress
- Activate the plugin through the `Plugins` menu in WordPress
- Go to `Appearance` and then `Widgets` and drag `ThinkTwit` to your sidebar
- Fill in the options as required and then save
Updates are automatic. Click on `Upgrade Automatically` if prompted from the admin menu. If you ever have to manually upgrade, simply replace the files with those from the new version.
NOTE: For those inexperienced with CSS, simply add the following to the bottom of your CSS file for basic formatting:
/* ThinkTwit - Twitter Widget */
ul.thinkTwitTweets {
font-size : 12px;
}
ul.thinkTwitTweets li.thinkTwitTweet {
word-wrap : break-word;
}
ul.thinkTwitTweets li.thinkTwitTweet span.thinkTwitPublished {
display : block;
}
Roadmap
The following is a list of features (in no particular order) that will be implemented in future releases:
- Caching of Twitter API calls
- Allow display anywhere through single function call
- Implement shortcode
- Implement filters
- Implement internationalisation
Download
ThinkTwit is hosted at WordPress Plugins.
Hello, your plugin is simple and powerful at the same time, I 3 twitters and it’s great to be able to list them all together, I probably will use it to print my tweets.
I have some requests and suggestions, to make it better:
1) before returning the output, add a filter to be applied to it
2) Add a space before span class=”thinkTwitPublished”, it’s first word is getting together with the tweet. Better yet, use a <br so that it goes 1 line below
3) I'm only able to show last week tweets, is it a twitter limitation or is your plugin? I'd like to show older ones too
4) Since more than 1 twitter can be used, add an option to show its @address instead of the user name, all my twitters have my name and I'd like each of them to be distinguished in the list
5) separate the widget class from you code, and add a function/object to print it anywwhere wanted, and a shortcode too :p
6) since tweets are sorted by date, ol is more semantic than ul
7) in line 244 u are doing str_replace using the same character, what's the meaning of that? o.O
Hi Hikari,
Wow – lots to think about there! I’ll respond per number:
1) What sort of filter do you mean?
2) Ah – here I used the class name so it can be styled as you wish. I suggest you create a CSS class of span.thinkTwitPublished and use “display: block” to force it to the next line. If you wanted space before it you could add a “margin: 5px” or something.
3) The restriction is in the Twitter API. I plan to implement a cache at some point; this will reduce calls to the API, allow it to work if Twitter goes down, and also display tweets older than 7 days.
4) I assume you mean to display username rather than name? Ok I’ll implement that as a feature.
5) Will do.
6) Good point!
7) That is a very good question! I took the code from somewhere else and have adapted it. Had a look at these lines and there seems to be no need so I’m not sure if it’s redundant from a previous use or if it’s a mistake. Either way I’ll remove it and test before my next release!
Thanks very much for the feedback. I’ve added your suggestions to my roadmap and will hopefully implement some changes this week if I have time.
1) by filter I mean
apply_filters('tag',$resource)with it we can hook filters to your content without needing to add code direcly in your plugin
4) thanks
7) I suppose it was meat to convert tag special chars to HTML codes, but it’s not being done
tnx for the help, to start using it all I need is a filter that I can hook and @username linking to the http://twitter.com/username
Hi Hikari,
Ok I’ve made a couple of changes but I’m really flummoxed with filters. I’ve not been using Wordpress very long and in some cases I find the documentation very poor. Are you able to explain to me how filtering works within plugins?
I get that a filter modifies some content, but what exactly do you want to filter in ThinkTwit? And any idea as to how I go about this?
Thanks!
Contact me on email and I can show you.
The hook won’t change the content, it will allow other plugins to edit the content without having to hack your code.
I want it to obfuscate links
I can’t leave external links on all pages, they are link juice leakers
I just saw you updated the plugin, soon I’m gonna test it.
Hi, I must say that I’m not a fan of the new look. I don’t like the digits, because they make the tweets not entirely visible in my sidebar. I would prefer a thicker line between the tweets or some other solution to divide the tweets. The look was better before.
Otherwise I like ThinkTwit a lot!
Hi Ingela,
You can modify the look by changing the CSS. If you give me a link to where you are using it I can give you some suggestions of what CSS to add. You’ll have to bear with me though as my main PC is out of action so am using my work laptop but don’t have access to all my code and tools.
Thanks for the positive comment
Hi,
Only the first username appears in the site… If I change the order, the other username appears, but only one.
Hi Sergio,
Could you please explain the problem you are having in more detail? And maybe show me an example.
I believe you are saying that it will just display the name or the username e.g. Stephen Pickett or stephenpickett in my case. This is by design, what are you looking to achieve?
Thanks!
Sorry,
In the widget, in the field that say to input the usernames separated by space, a input different users and save, but the plhgin only shows the tweets from the first user in the list. If I change the order only the tweets from the new first user is published.
Tks.
Hi Sergio,
Have you checked that the other user has tweeted recently? This was the case in another instance of this “issue” i.e. it was really an issue, just that the other user hadn’t tweeted in the last 7 days and the other user had 5 of the most recent tweets.