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

  #301  
Old 25 Mar 2010, 02:15
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Originally Posted by captainslater View Post
What have I done wrong?
Probably nothing, it's a server error. Perhaps, like many of us, you simply cannot use bitly.
Reply With Quote
  #302  
Old 25 Mar 2010, 04:44
ps2wiz ps2wiz is offline
 
Join Date: Apr 2005
Thanks, I set it up and it's working great so far.

But, will this work on a 3.7 forum too?
Reply With Quote
  #303  
Old 25 Mar 2010, 05:58
captainslater's Avatar
captainslater captainslater is offline
 
Join Date: Dec 2005
Real name: Dominic
Originally Posted by Videx View Post
Probably nothing, it's a server error. Perhaps, like many of us, you simply cannot use bitly.
Maybe but disabling the bitly function leads to another DB-error :/
__________________
If you need a translation to german - I'm your man!
Reply With Quote
  #304  
Old 25 Mar 2010, 12:17
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Originally Posted by captainslater View Post
Maybe but disabling the bitly function leads to another DB-error :/
Then you really must read through the entire thread a few mores times. It's unlikely you're getting errors that others haven't already gotten. If worse comes to worse, use the hacked version I posted a while back.
Reply With Quote
  #305  
Old 25 Mar 2010, 18:40
phkk phkk is offline
 
Join Date: Feb 2006
My server behind an cisco ASA and IPS firewall. So i received an empty call from the twitter. I have to whitelist twitter.com ip address.
Reply With Quote
  #306  
Old 25 Mar 2010, 18:43
phkk phkk is offline
 
Join Date: Feb 2006
"empty reply from server on line"
Reply With Quote
  #307  
Old 26 Mar 2010, 19:48
LbR's Avatar
LbR LbR is offline
 
Join Date: Nov 2009
WOWOWOWOWOOWOWO It worked for me don't know how it worked Hulaaaaaaaay!
Reply With Quote
  #308  
Old 27 Mar 2010, 20:23
IsMaR IsMaR is offline
 
Join Date: Nov 2004
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/soicey/public_html/bitly.php on line 139

Hm... Guessing I need to enable curl?
Reply With Quote
  #309  
Old 28 Mar 2010, 04:03
RedPitSea RedPitSea is offline
 
Join Date: Nov 2007
It works for me too. TheLoboLair twitter feed. We run about 100 new threads a day. The guests aka bots and spiders on the site all day is ridiculous. lol
Reply With Quote
  #310  
Old 28 Mar 2010, 06:33
kefallon kefallon is offline
 
Join Date: Jun 2008
Not looked in on this thread recently, anyone manged to sort out the server issue with this error message??


tatuses/update.xml Could not authenticate you. Unauthorized on line 229 in /var/www/vhosts/ionian-island.co.uk/httpdocs/forums/twitter.php
#0 /var/www/vhosts/ionian-island.co.uk/httpdocs/forums/twitter.php(648): Twitter->doCall('statuses/update...', Array, true)
#1 /var/www/vhosts/ionian-island.co.uk/httpdocs/forums/newthread.php(262) : eval()'d code(26): Twitter->updateStatus('test http://www...')
#2 /var/www/vhosts/ionian-island.co.uk/httpdocs/forums/newthread.php(262): eval()
#3 {main}
Reply With Quote
  #311  
Old 28 Mar 2010, 22:44
Manoel Júnior's Avatar
Manoel Júnior Manoel Júnior is offline
 
Join Date: Feb 2009
Real name: Manoel Júnior
How do I work with vBulletin?
Reply With Quote
  #312  
Old 29 Mar 2010, 01:44
IsMaR IsMaR is offline
 
Join Date: Nov 2004
^sorry it only works with phpnuke, since this is a phpnuke forum...
Reply With Quote
  #313  
Old 29 Mar 2010, 01:52
bigtree bigtree is offline
 
Join Date: Jan 2009
rocking!

vb 4.0.2.pl4 is perfect.
only issue I had was the need to go into my http://bit.ly/ account and setup the link for twitter.

Cheers!
Reply With Quote
  #314  
Old 31 Mar 2010, 16:15
milaszewski milaszewski is offline
 
Join Date: Jun 2008
Polish characters are displaying incorrectly. Any way of solving it? Please take a look: www.twitter.com/dzwiek
I use iso-8859-2 coding
Reply With Quote
  #315  
Old 31 Mar 2010, 19:41
GamerPerfection's Avatar
GamerPerfection GamerPerfection is offline
 
Join Date: Feb 2006
After several hours of messing around with this i finally got it working.

// If you are having trouble getting bitly URL shortening to work... disable it!
basically I got it working by disabling the bitly url.

Can I just ask why have bitly url if it works when disabling it?

Also after reading through every page of this thread and several people have said you need CURL and JSON installed and enabled for it to work then isn't it better for you to mention that in the opening post?
__________________
Gamer Perfection
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 10:00.

Layout Options | Width: Wide Color: