Version: .1b, by AHealthForum
Developer Last Online: Jul 2012
Category: Add-On Releases -
Version: 3.8.1
Rating:
Released: 03-15-2009
Last Update: 03-15-2009
Installs: 132
Additional Files
No support by the author.
vBulletin2 Twitter Courtesy A Health Forum http://ahealthforum.com
Special Thanks to Jarvis From http://seovb.com for help
vbtotwitt.php copyright Vojtech Semecky released under the terms of GPL
================================================== =========
This modification will take one of your latest news threads and post it directly to your twitter account. You must have RSS enabled for this modification to work. You can specify a forum to pull the content from using external.php?f=FORUMID
The RSS feed will post your thread title directly into your Twitter account, and then create a link back using TinyURL. The links are automatically converted into tinyurl.com links via the TinyURL API
Install instructions
1. Upload the includes folder into your forum root. This will automatically place the 2 scripts need to operate this into the "includes/cron/" folder
2. Install the product-ahealthforumcomvbtwit.xml file via the Product Manager in your adminCP
3. Navigate to vBulletin Options -> vBulletin Options -> vBulletin 2 Twitter and enter your name and password.
4. Hit Save and Wait 2 minutes
5. View your twitter account to confirm that an update was posted.
6. Enter the URL to your forum feed.
Notice: By default for testing purposes this makes one tweet announcing you've installed vB2Twitter You are free to delete this tweet as it is for testing purposes only!!!!
1. Twitter Username: This is your Twitter.com username. If you don't have one yet, you can get one for free at http://twitter.com
2. Twitter Password: This is your password for your twitter account. Notice that its not hashed or encypted so anyone with adminCP access can view it. If you can't trust those who have your AdminCP information with such details, then this mod isn't for you sorry.
3. Feed URL: This can be to any sites feed if you want, but I suggest pointing it to your news forum and creating a prefix such as [Breaking News] to make the most of this. Your twitter posts will then be prefixed with [Breaking News] Thread Title link to thread.
Again, this modification will take the latest thread from the forum RSS feed you specify. I don't beleive in spamming on twitter with useless crap, so I've made this modification to only take one thread at a time from your forums RSS feed.
Trouble Shooting:
If it does not automatically update to your account. Go into the scheduled tasks manage and run the task manually.
external.php gives a blank page. Enable RSS from your vBulletin Admin Control Panel.
here is the code I've implemented to get around the duplicate issue.
The issue arose when the latest thread was not the current status of the twitter account, so I updated the code to search the entire feed page for the thread title. It now checks the contents of your twitter page and looks for a match with the title of the first item in the RSS feed, if it finds it it does not try to repost. If it does not find a match it will call the twitter API and submit the message.
I then had an issue where it was posting <![CDATA[thread title]]. I discovered that this only occurred when there was an apostrophe in the thread title, so I added a replace command to strip out the CDATA text.
There was also an issue where if your server did not receive a response from the twitter page in a timely fashion the script would not find a match for the latest title thread and would repost. I added a line in the script to search for your account name in the page, and if it finds it then call the twitter API. This ensures that there is no more double posting.
You need to replace the contents of the twitask.php file in the includes\cron folder with the script below. You need to replace the ACCOUNTNAME text in the line http://twitter.com/ACCOUNTNAME with the name of your twitter account. this needs to be in the same case as the account name appears on your twitter page.
PHP Code:
<?php // vBulletin2Twitter Provided Via http://ahealthforum.com // Inspiration from Reuqests and various free open source scripts // twitask.php may not be reproduced without prior written permission // See vbtotwitt.php for open source script usage // // Set error status error_reporting(E_ALL & ~E_NOTICE);
$tiny_url = file_get_contents("http://tinyurl.com/api-create.php?url=" . $url); $status = $title . " " . $tiny_url; echo $status; //just for status if you are directly viewing the script
// Output Log Status log_cron_action($logmsg, $nextitem); } else { echo '<br />twitter page not found'; } }
?>
If you have $cronimage in your footer template and have the twitter scheduled task set to run every minute each time a new thread is started the title will be updated. You will also need to set the refresh time on your RSS feed in vboptions to 0 if you want to ensure that every new thread is updated to your twitted feed. If the refresh time is 60 minutes you will only have the latest thread submitted every hour when the RSS cache is refreshed.
I've been running with the above script and options for the last several days and have eliminated the duplicate posting issues.
Nice work... working fine for me...
thanks a lot..
do you have any idea about the plain text password?
why we can not use
Been using twiterfeed for quite a while now. It works. Not every post is tweeted in big, active forums, but it is a very good automatic twitter feed. I have no use for twitter, but for 'SEO' purposes one should have a twitter account.