Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
vBulletin to Twitter, live tweets of new threads Details »
vBulletin to Twitter, live tweets of new threads
Mod Version: 1.00, by buro9 (Member) buro9 is offline
Developer Last Online: Jul 2012 I like it Show Printable Version Email this Page

This thread is in the Modification Graveyard.
vB Version: 4.0.x Rating: (33 votes - 4.67 average) Installs: 272
Released: 27 Jan 2010 Last Update: Never Downloads: 1482
Not Supported Uses Plugins Additional Files Re-usable Code Translations External Content  

This should work on all 4 and 3 versions of vBulletin as it's trivial.

Description:

You start a new thread, this hack makes a tweet about it on your twitter account.

This are live updates... not delayed, not based on RSS... the instant the thread is started, a tweet is made. This is how this hack differs from other hacks.

Why:

Mostly for SEO, but also as an alert system.

For SEO the idea is simply that search engines are drinking from the Twitter firehose and are indexing the links that are tweeted. Faster and increased indexing of your site benefits you by helping it be found.

For alerts it means that users are able to use whatever twitter client they wish to obtain updates. A lot of these provide filtering capabilities, so they're able to get a live filtered stream of updates that interest them. This works very well when you also use thread prefixes.

Pre-requisites:

You should have an account on bit.ly for URL shortening, and you should have an account on Twitter.

Go and register if you haven't yet:
http://bit.ly/
http://twitter.com/

Installation:

NOTE: Most problems are related to not putting your bit.ly or twitter user details in the plugin. Follow the instructions carefully!

Upload the two attached files to your forum root. These are twitter and bitly classes that enable the hack to work, you can also download these from the author:
http://classes.verkoyen.eu/bitly
http://classes.verkoyen.eu/twitter/

Go to the plugin manager and create a new plugin with the following details:
Product: vBulletin
Hook: newthread_post_complete
Title: Tweet to Twitter

PHP Code: [See below]

To configure the PHP code you need to know your bit.ly API key (go get it from bit.ly/account) and your username and password for twitter.

You also should make a list of the forumIds that are non-public as you will want to put these in the array provided.

i.e. if your admin forum is forumId = 7 and you also have a private forum for regular members which is forumid = 12, then you will want this:
$excludedForums = array(7, 12);

The PHP code should be this, with all of the relevant values for your forum inserted (replace everything bolded, including the < and > bits):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So the bit.ly line might look like this after you've put your values in:
$bitly = new Bitly('testUser', 'R_hj3456hgf3hig56hi2gf6');
NOT
$bitly = new Bitly('<testUser>', '<R_hj3456hgf3hig56hi2gf6>');
See? Remove those <> bits, they just show what to replace.

The shortUrl line might look like this:
$shortUrl = 'http://www.vbulletin.com/forum/showthread.php?t='.$newpost[threadid];

The Twitter line might look like this:
$twitter = new Twitter('stephenfry','op1umisn1ce');

All make sense?

And that's it. Save and activate the plugin and create a test thread.

Now whenever a new thread is started, a tweet will be made to twitter instantly.

You can see this in effect here:
http://twitter.com/lfgss

That is being pushed new threads for http://www.lfgss.com/ and it's working perfectly.

Any questions?

FAQ (Frequently Asked Questions)

Q: It doesn't work!

A: That's not a question, however if it doesn't work then it's extremely likely you got your username and passwords wrong or left the < > signs in there. Double-check and do it again.

Q: I see an "INVALID_JSON" error

A: Disable bitly by setting $useBitly to false.
Q: I see an "You must be authenticated to access shorten" error

A: The credentials that you entered are either wrong, or you made a mess of the syntax. You did remove the < > when you put your values in right? Did you check the example given above?

Q: I see an error that says "Warning: curl_setopt_array() [function.curl-setopt-array]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in [path]/bitly.php"

A: Wow, that's a good one... but easily fixable. Insert this at line 136 (just after the CURL options) in bitly.php:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Add-On Releases vBulletin 2 Twitter - Take Your News Straight To Twitter! AHealthForum vBulletin 3.8 Add-ons 115 22 Feb 2013 22:02

  #331  
Old 12 Apr 2010, 12:40
sticky sticky is offline
 
Join Date: Sep 2003
I'm considering installing this as I want more traffic but won't people get offended or annoyed with every new thread being tweeted?
Reply With Quote
  #332  
Old 12 Apr 2010, 13:33
milaszewski milaszewski is offline
 
Join Date: Jun 2008
Originally Posted by nstlx View Post
I solved the problem like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Twitter uses utf8, so it with be ok also with English....

nstlx
it doesn't work... my forum is not utf8, it's iso-8859-2
Reply With Quote
  #333  
Old 12 Apr 2010, 13:44
milaszewski milaszewski is offline
 
Join Date: Jun 2008
Originally Posted by milaszewski View Post
it doesn't work... my forum is not utf8, it's iso-8859-2
solved!
I added this line:
$tweet = iconv("ISO-8859-2", "UTF-8", $tweet);
Reply With Quote
  #334  
Old 12 Apr 2010, 23:18
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Originally Posted by sticky View Post
I'm considering installing this as I want more traffic but won't people get offended or annoyed with every new thread being tweeted?
On a busy forum they certainly could. I use Digsby and always have a window open showing nothing but new threads on the forum, but not everyone is savvy enough to use filters like that.
Reply With Quote
  #335  
Old 12 Apr 2010, 23:24
sticky sticky is offline
 
Join Date: Sep 2003
Originally Posted by Videx View Post
On a busy forum they certainly could. I use Digsby and always have a window open showing nothing but new threads on the forum, but not everyone is savvy enough to use filters like that.
I see, so is there something that can allow to pick and choose which threads to tweet by clicking a button instead of doing it manually?
Reply With Quote
  #336  
Old 12 Apr 2010, 23:57
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Originally Posted by sticky View Post
I see, so is there something that can allow to pick and choose which threads to tweet by clicking a button instead of doing it manually?
Who the heck would have the time to sit and do that in a timely fashion? Especially on a busy board. More realistically, just limit tweeting to exclude your busiest forums. But there's nothing stopping you from manually tweeting if you really want to go that route.
Reply With Quote
  #337  
Old 13 Apr 2010, 00:00
Jabong82 Jabong82 is offline
 
Join Date: Feb 2010
Anyone else have a separate Twitter account?

I just use this for SEO and have a separate account that people can follow. So 1 account for your updates/followers and another just for this mod.
Reply With Quote
  #338  
Old 13 Apr 2010, 00:04
sticky sticky is offline
 
Join Date: Sep 2003
Originally Posted by Videx View Post
Who the heck would have the time to sit and do that in a timely fashion? Especially on a busy board. More realistically, just limit tweeting to exclude your busiest forums. But there's nothing stopping you from manually tweeting if you really want to go that route.
I know, but what I was hoping is simply a tweet button next to where it says quote which would tweet the thread using a url shortener. Simple... I don't want to spam my followers with every thread.
Reply With Quote
  #339  
Old 13 Apr 2010, 00:05
sticky sticky is offline
 
Join Date: Sep 2003
Originally Posted by Jabong82 View Post
Anyone else have a separate Twitter account?

I just use this for SEO and have a separate account that people can follow. So 1 account for your updates/followers and another just for this mod.
I see, two accounts would work but if there are no followers what is the point?
Reply With Quote
  #340  
Old 13 Apr 2010, 00:32
Jabong82 Jabong82 is offline
 
Join Date: Feb 2010
Originally Posted by sticky View Post
I see, two accounts would work but if there are no followers what is the point?
Well if you have your posts tweeted, they create outside links to your site, which is one of the most important factors in search engine optimization (ie. ranking higher on google).

So yah no one would see it because you'd have no followers on that account, but in theory your search engine rankings should improve which is good for your overall site traffic.
Reply With Quote
  #341  
Old 13 Apr 2010, 08:42
LifesGreatestGift's Avatar
LifesGreatestGift LifesGreatestGift is offline
 
Join Date: Jul 2009
Thanks for the fix!

http://www.vbulletin.org/forum/showp...&postcount=287

Works perfect now! No more bit.ly or twitter php issues.
__________________
If I have helped you, the least you could do is click the button to show your appreciation.
TheSecond.org - Because it is our right!
Reply With Quote
  #342  
Old 14 Apr 2010, 10:47
zelnik zelnik is offline
 
Join Date: Aug 2008
Installed and working great first time!

Thanks a million!
Reply With Quote
  #343  
Old 14 Apr 2010, 16:35
zelnik zelnik is offline
 
Join Date: Aug 2008
Just noticed that my RSS feeds are not being directed to Twitter?!?!

Noticed a lot of people saying the same.. I wouldn't mind making a small finanical donation if you could get RSS posts to be posted on Twitter?!

I'm sure others would also.

Last edited by zelnik; 14 Apr 2010 at 18:57.
Reply With Quote
  #344  
Old 15 Apr 2010, 17:09
osayidan osayidan is offline
 
Join Date: Sep 2006
is bit.ly having issues? I can not seem to register...
"There was a problem posting your request. Please try again."

Been trying for quite some time now.

edit: never mind, that was disgusting... i couldn't sign up with FF 3.6, loaded up my old IE 6 and it worked...

Last edited by osayidan; 15 Apr 2010 at 17:16.
Reply With Quote
  #345  
Old 16 Apr 2010, 14:10
Chicken Racer Chicken Racer is offline
 
Join Date: Feb 2005
Originally Posted by zelnik View Post
Just noticed that my RSS feeds are not being directed to Twitter?!?!

Noticed a lot of people saying the same.. I wouldn't mind making a small finanical donation if you could get RSS posts to be posted on Twitter?!

I'm sure others would also.
Yes I 2nd that !
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 04:40.

Layout Options | Width: Wide Color: