WP-Quote-Tweets allows authors to quote Twitter updates in posts or pages using a simple shortcode.
[quotetweet tweetid=123456789].
The tweetid can be found in the URL of the tweet that you want to quote.
For example. the following tweet has this URL: http://twitter.com/TCorp/status/2220563803
Its tweetid is 2220563803, making the shortcode look like this:
[quotetweet tweetid=2220563803]
Resulting in….
if the icon doesn’t work, it most likely due to twitter.com cluster cache and not this plugin. :-p
The WP Quote Tweets plugin is available for download on wordpress.org
Author: Tanin
Tanin in an information technology consultant specializing in complex heterogeneous environments. He can be reached through multiple social networking sites including Twitter.




















































Works great, thank you
Is it possible to use this plugin in the theme files using a php function?
Lovely stuff. Thanks.
I’ve never done that, but in theory, you could try to call the ‘wp_quote_tweet_exec’ function in the class manually. Note that you’ll have to pass on an array as parameter (Something like array(‘tweetid’=>’12345678′))
Thanks – so for example would it look something like this?:
wp_quote_tweet_exec(array(‘tweetid’=>’2622665396′));
or
wp_quote_tweet_exec(array(‘tweetid’=>$tweetID));
I tried this and had no luck – is anything wrong with that code?
Essentially for each post I make about a certain person, I want to include in the template a featured tweet, which a function fetches using the $tweetID from a post Custom Field.
I tried do_shortcode() but couldn’t work out how to pass the $tweetID to it!
Again, I haven’t tested this, but try the following:
// manually create an instance of the class:
$quotedTweet = new wpQuoteTweet();
// manually execute the function and echo out its contents
echo $quotedTweet->wp_quote_tweet_exec(array(‘tweetid’=>$tweetID));
It worked! Legend.
Thanks so much for your help
)
I will post here when the site is done so you can see it in action.
J
Just one more question to bug you with:
If I’m using this plugin to show two or three featured tweets from various users on my site, and I get thousands of visitors every day, is that going to cause problems with Twitter?
I’ve heard stories about there being issues with making a large number of requests. Any advice?
Thanks
)
If your /cache/ subdirectory is writable, each generated tweet will be cached in there for 24 hours.
Thanks
fyi. the above smileys were intended to be : ) not :O
Last question I promise
Is it possible to edit the plugin so that it returns hyperlinks that open in a new window?
I don’t really understand the plugin code well enough to edit it myself.
Thanks again.
All links that are automatically generated already have the rel=”external” attribute. You can use javascript to make those open in a new window (the XHTML compliant way)
Something like this:
function externalLinks() {
var anchor = anchors[i];if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i
if (
anchor.getAttribute("href") && (
anchor.getAttribute("rel") == "external" ||
anchor.getAttribute("rel") == "external nofollow" ||
anchor.getAttribute("rel") == "nofollow external" )
)
anchor.target = "_blank";
}
}
window.onload = function() {
externalLinks();
}
Thanks!
Perfect.
Quick bug report.
When I tried to use this I got the error “URL file-access is disabled in the server configuration”. Most hosting providers restrict the use of file_get_contents for security reasons. I was able to get it working by changing the two file_get_contents($url) into cURL – like so…
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle,CURLOPT_URL,$url);
$content = curl_exec($curl_handle);
curl_close($curl_handle);
$status = new SimpleXMLElement($content);
For security and interoperability, you may want to make those changes in the next release of the plugin.
HTH
T
Issue has been addressed and solution implemented in version 2.2.3.
Thanks for the report.
- Tanin
Hi there! Thanks for that great plugin! Very nice idea. Unfortunately it doesn’t work here. I always get
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /***/wp-content/plugins/wp-quote-tweets/wp_quotetweets.php on line 257
Do you know what’s causing this problem? I tried it on a brand new WP installation and it didn’t work
Hi! This is Markus again. Finally the WP Quote Plugin works. But it was neccessary to upgrade to PHP 5. The standard PHP version is 4.4.9 at my webhost all-inkl.com. Just in case another plugin user has the same experience.
Again, thanks for the really nice plugin.
Best,
Markus
And for the third time
I hope I’m not buggin you. I just wrote an article about WP Quote Tweets on my other blog http://www.bloggezwitscher.de/tweets-im-blog-einbinden-die-zweite-wp-quote-tweets/ .
Besides the really cool features you provide with your plugin there are some drawbacks:
Tweets look really ugly in feedreaders
error messages in case your server IP uses too many API pulls
There should be the option to disable “recaching” of tweets after 24 hours
If you’re still working on the plugin it would be cool to implement some of those ideas
Have a nice week. Best regards
Markus
Thanks for the feedback, Markus. This plugin definitely needs to be refined further and it can only be done with helpful feedback like yours.
All of the above comments have been addressed in 3.0.0. If you see anything else, let me know.
- Tanin
OK, fine…version 3.1.0 will cache the entire xml files as it reads from the twitter. Will be released once I can give it a good run through testing.
Hey Tanin! This is so cool! Thanks for 3.0.0!
Hey Tanin -
Thanks for the plugin!
I am having an issue after I updated today.
When a new post comes onto the blog it throws an error on the first load only.
“Warning: file_put_contents() [function.file-put-contents]: Filename cannot be empty in /home/thefinge/public_html/wp-content/plugins/wp-quote-tweets/wp_quotetweets.php on line 374″
Would you be able to help? Is there just some warning option I need to suppress?
D’oh!
That should not have been left there. I just released 4.0.2. A fixed has been applied in this release.
- Tanin
how do I reduce the size of the tweet quotes on my site?
Try selecting a different template in the settings page.
I tried to install your plugin, but it failed
“Parse error: syntax error, unexpected ‘{‘ in /wp-content/plugins/wp-quote-tweets/wp_quotetweets.php on line 412″
I used your latest version, can you help me?
thank you!
horst, you need php5 for this plugin. What version are you running?
Oh, I’ve got just php4.
Thank you for your fast answer!
PHP 5 was released 5 years ago. You may want to inform your provider and have them upgrade php.
Hi Tanin:
In theory, I love this plugin. Unfortunately, I can't get it to activate on my blog. I've made the subfolder writable and have tried it as 766 and 777. Both times, when I try to activate the plugin, I get this fatal error:
Parse error: syntax error, unexpected '{' in /home/.tatoo/adminpatrick/patrickkphillips.com/wp-content/plugins/wp-quote-tweets/wp_quotetweets.php on line 422
I suppose it's entirely possible that I'm not running php5. But I have absolutely no idea how to determine this. Could this be the problem, or would you have any other suggestions?
@Patrick, you’re correct. The line you’re referring to uses a PHP5 error handling routine (ironic, i know). Your current PHP version is 4.4.9. I would highly recommend upgrading to PHP 5.x.x.
That was exactly the problem. It's now working well! Thanks so much!
I'm only seeing “Warning: file_put_contents(/home/randrews/public_html/wp-content/plugins/wp-quote-tweets/xmlcache/twitterTweet.6907314312.xml) [function.file-put-contents]: failed to open stream: Permission denied in /home/randrews/public_html/wp-content/plugins/wp-quote-tweets/wp_quotetweets.php on line 418″
… and the style isn't being applied to the tweet correctly either.
@Robert, check the rights on the xmlcache directory. It’s not writable, so the script can’t…write.
When I try to activate the plugin, I get this fatal error:
Parse error: syntax error, unexpected '{' in /home/.tatoo/adminpatrick/patrickkphillips.com/wp-content/plugins/wp-quote-tweets/wp_quotetweets.php on line 422
my current PHP version is 5.2.9
I used your latest version, can you help me?
Thanks so much!
According to the info I found, you’re running PHP/4.4.9 and not 5.2.9.
http://uptime.netcraft.com/up/graph/?host=edutec-peru.org&Examine=Find