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 23:02

  #631  
Old 12 Jan 2014, 17:16
demdev demdev is offline
 
Join Date: Oct 2013
Awesome, thanks for the hack!
Reply With Quote
  #632  
Old 13 Jan 2014, 14:01
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
I get when i make a thread a white page on my forum what i do wrong? its stay on newthread.php?do=postthread&f=25

Last edited by Wajow-community; 13 Jan 2014 at 14:16.
Reply With Quote
  #633  
Old 13 Jan 2014, 14:23
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
{"errorCode": 0, "errorMessage": "", "results": {"http://www.forums.domein.nl/showthread.php?t=2782": {"userHash": "1lUV7TQ", "shortKeywordUrl": "", "hash": "1lUV7TS", "shortCNAMEUrl": "http://bit.ly/1lUV7TQ", "shortUrl": "http://bit.ly/1lUV7TQ"}}, "statusCode": "OK"}Invalid JSON-response on line 196 in /home/admin/domains/domein.nl/public_html/forums/bitly.php
#0 /home/admin/domains/domein.nl/public_html/forums/bitly.php(382): Bitly->doCall('shorten', Array)
#1 /home/admin/domains/domein.nl/public_html/forums/newthread.php(277) : eval()'d code(33): Bitly->shorten('http://www.foru...')
#2 /home/admin/domains/domein.nl/public_html/forums/newthread.php(277): eval()
#3 {main}


Fatal error: Invalid JSON-response on line 196 in [path]/bitly.php in [path]/vb/vb.php on line 286
#0 vb_error_handler(256, Invalid JSON-response on line 196 in /home/admin/domains/domein.nl/public_html/forums/bitly.php , /home/admin/domains/domein.nl/public_html/forums/vb/vb.php, 286, Array ([exception] => BitlyException Object ([] => Invalid JSON-response,[] => ,[] => 0,[] => /home/admin/domains/domein.nl/public_html/forums/bitly.php,[] => 196,[] => Array ([0] => Array ([file] => /home/admin/domains/domein.nl/public_html/forums/bitly.php,[line] => 382,[function] => doCall,[class] => Bitly,[type] => ->,[args] => Array ([0] => shorten,[1] => Array ([longUrl] => http://www.forums.domein.nl/showthread.php?t=2782,[history] => 1))),[1] => Array ([file] => /home/admin/domains/domein.nl/public_html/forums/newthread.php(277) : eval()'d code,[line] => 33,[function] => shorten,[class] => Bitly,[type] => ->,[args] => Array ([0] => http://www.forums.domein.nl/showthread.php?t=2782)),[2] => Array ([file] => /home/admin/domains/domein.nl/public_html/forums/newthread.php,[line] => 277,[function] => eval)),[] => ),[code] => 256)) #1 trigger_error(Invalid JSON-response on line 196 in /home/admin/domains/domein.nl/public_html/forums/bitly.php , 256) called at [/home/admin/domains/domein.nl/public_html/forums/vb/vb.php:286] #2 vB::handleException(BitlyException Object ([] => Invalid JSON-response,[] => ,[] => 0,[] => /home/admin/domains/domein.nl/public_html/forums/bitly.php,[] => 196,[] => Array ([0] => Array ([file] => /home/admin/domains/domein.nl/public_html/forums/bitly.php,[line] => 382,[function] => doCall,[class] => Bitly,[type] => ->,[args] => Array ([0] => shorten,[1] => Array ([longUrl] => http://www.forums.domein.nl/showthread.php?t=2782,[history] => 1))),[1] => Array ([file] => /home/admin/domains/domein.nl/public_html/forums/newthread.php(277) : eval()'d code,[line] => 33,[function] => shorten,[class] => Bitly,[type] => ->,[args] => Array ([0] => http://www.forums.domein.nl/showthread.php?t=2782)),[2] => Array ([file] => /home/admin/domains/domein.nl/public_html/forums/newthread.php,[line] => 277,[function] => eval)),[]
i have this error?? what now?
Reply With Quote
  #634  
Old 13 Jan 2014, 15:47
nxtgen nxtgen is offline
 
Join Date: Sep 2013
Interesting. No errors.. Details are correct.. Is there a log somewhere so I can see what is failing?
Reply With Quote
  #635  
Old 13 Jan 2014, 16:00
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
Originally Posted by nxtgen View Post
Interesting. No errors.. Details are correct.. Is there a log somewhere so I can see what is failing?
I will also do everything apart properly followed and filled ..

I use vbulletin 4.2.1 and when I do I immediately the subject site is redirected to the error that I mentioned above.
Reply With Quote
  #636  
Old 13 Jan 2014, 18:35
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Originally Posted by Wajow-community View Post
i have this error?? what now?
If you read back you'll find that a few people have managed to hack the heck out of it and get it working. But there's an actual working and supported product at: WS vBulletin Tweet Poster
Reply With Quote
  #637  
Old 14 Jan 2014, 19:46
Wajow-community Wajow-community is offline
 
Join Date: Dec 2009
Originally Posted by Videx View Post
If you read back you'll find that a few people have managed to hack the heck out of it and get it working. But there's an actual working and supported product at: WS vBulletin Tweet Poster
the same error as this one.
Reply With Quote
  #638  
Old 08 Mar 2014, 23:46
webmaster74 webmaster74 is offline
 
Join Date: Mar 2007
Originally Posted by Videx View Post
OMG do you read at all?

YES THIS MOD WILL STOP WORKING 8/30/2010. EVERYONE STOP INSTALLING IT FOR GOD'S SAKE!
...... and we only discover this after spending an hour doing the changes and another hour reading the support........ thank you. This statement must appear in big bold red in the FIRST post.
__________________
the vbulletin script is way too expensive for the support you get.....
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 00:13.

Layout Options | Width: Wide Color: