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

  #361  
Old 30 Apr 2010, 04:44
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Originally Posted by Bob_R View Post
Same here.
Assuming you aren't on dedicated servers, I hope you both immediately opened tickets with your hosts asking this same question? We need to know exactly what they're doing to break things and how to fix it.
Reply With Quote
  #362  
Old 01 May 2010, 13:56
Bob_R Bob_R is offline
 
Join Date: Jun 2009
Smile

Originally Posted by Videx View Post
Assuming you aren't on dedicated servers, I hope you both immediately opened tickets with your hosts asking this same question? We need to know exactly what they're doing to break things and how to fix it.
I did submit a ticket yesterday morning.

In the meantime I can tell you this. I switched web hosts this week. Since then this vbulletin to twitter, live tweets of new threads hasn't worked.

Any other suggestions?
Reply With Quote
  #363  
Old 02 May 2010, 12:26
ukiya006 ukiya006 is offline
 
Join Date: Apr 2008
Originally Posted by Xeon3D View Post
I'm getting the word "Array" appended to the end of each message and no link to the thread as you can check here:

http://twitter.com/xeon3dinfo/

here's my plugin contents:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
I am having the same problem as him =(
Any solutions so far?

I came across tis error a few mins ago..
it seems related..

Status is a duplicate. on line 204 in /home/cbnoobco/public_html/thesgmall/twitter.php
#0 /home/cbnoobco/public_html/thesgmall/twitter.php(648): Twitter->doCall('statuses/update...', Array, true)
#1 /home/cbnoobco/public_html/thesgmall/newthread.php(514) : eval()'d code(26): Twitter->updateStatus(' Array')
#2 /home/cbnoobco/public_html/thesgmall/newthread.php(514): eval()
#3 {main}


Fatal error: Status is a duplicate. on line 204 in [path]/twitter.php in [path]/vb/vb.php on line 287
Reply With Quote
  #364  
Old 02 May 2010, 12:46
ukiya006 ukiya006 is offline
 
Join Date: Apr 2008
Status is a duplicate. on line 204 in /home/cbnoobco/public_html/thesgmall/twitter.php
#0 /home/cbnoobco/public_html/thesgmall/twitter.php(648): Twitter->doCall('statuses/update...', Array, true)
#1 /home/cbnoobco/public_html/thesgmall/newthread.php(514) : eval()'d code(26): Twitter->updateStatus(' Array')
#2 /home/cbnoobco/public_html/thesgmall/newthread.php(514): eval()
#3 {main}


Fatal error: Status is a duplicate. on line 204 in [path]/twitter.php in [path]/vb/vb.php on line 287
Ok.. Manage to solve that.. Realised that I hooked it to the wrong location..

Hmm.. but now still got the word "Array" instead of the short url it's suppose to be showing.
Reply With Quote
  #365  
Old 02 May 2010, 13:54
ukiya006 ukiya006 is offline
 
Join Date: Apr 2008
Originally Posted by ukiya006 View Post
Ok.. Manage to solve that.. Realised that I hooked it to the wrong location..

Hmm.. but now still got the word "Array" instead of the short url it's suppose to be showing.
Solved.. by uploading the bitly.php that's available here instead of the one in the main website.
Reply With Quote
  #366  
Old 02 May 2010, 16:23
your24hourstore your24hourstore is offline
 
Join Date: Feb 2010
dont feel bad

Originally Posted by Videx View Post
Sure, for those that have bitly working (not me).
man i have tried everything , to getthis hack to work its just not working i have had all the error did all the fixs and still cant use it

Even though i get the errors , when i refreshed the error page it sent the tweets through, so its almost kinda working



NOT installed

Last edited by your24hourstore; 02 May 2010 at 17:53.
Reply With Quote
  #367  
Old 07 May 2010, 21:32
SlackerAPM SlackerAPM is offline
 
Join Date: Nov 2001
Real name: Adam
I apologise if this has been asked before, I did look through the thread but couldn't find anything...

Is it possible to specify forums to include rather than exclude as I only want to include 2 forums. It would easier for me do that rather than exclude 35 other forums.

Thanks.
Reply With Quote
  #368  
Old 07 May 2010, 21:37
your24hourstore your24hourstore is offline
 
Join Date: Feb 2010
teehee

Originally Posted by SlackerAPM View Post
I apologise if this has been asked before, I did look through the thread but couldn't find anything...

Is it possible to specify forums to include rather than exclude as I only want to include 2 forums. It would easier for me do that rather than exclude 35 other forums.

Thanks.
really live up to your name dont you
Reply With Quote
  #369  
Old 07 May 2010, 21:41
SlackerAPM SlackerAPM is offline
 
Join Date: Nov 2001
Real name: Adam
I should maybe change to EfficientAPM
Reply With Quote
  #370  
Old 07 May 2010, 21:45
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Near the first line there's a !. Take it out to make it an inclusion list.
if (!in_array
Reply With Quote
  #371  
Old 12 May 2010, 04:38
Bob_R Bob_R is offline
 
Join Date: Jun 2009
Originally Posted by Videx View Post
Assuming you aren't on dedicated servers, I hope you both immediately opened tickets with your hosts asking this same question? We need to know exactly what they're doing to break things and how to fix it.
They've never given a definite answer. Everyone's passing the buck. But the mod doesn't work for me.

safe_mode is disabled. I have Json and Curl compiled.

What else can it be?????????
Reply With Quote
  #372  
Old 12 May 2010, 17:12
Bob_R Bob_R is offline
 
Join Date: Jun 2009
OK here's the latest. I submitted a test thread and it went thru with no errors and is on my site.

But, it didn't tweet to twitter?

It's supposed to be instanteneous (sp?) right?

I wouldn't even have to wait any amount of time?

Thanks!!

Execution Order Use this field to enter the order in which code at the same hook will be executed. What should this number be?

Last edited by Bob_R; 12 May 2010 at 17:23. Reason: Added question
Reply With Quote
  #373  
Old 12 May 2010, 21:01
clubplanet clubplanet is offline
 
Join Date: Dec 2001
Real name: DaVe
Great mod, thanks!

A couple of things to note:

1. Make sure you download all the PHP code. I missed the bracket at the end and got the error:
PHP Parse error: syntax error, unexpected $end in

2. Download the bitly.php file from this thread not from the URL linked in the post. The link is newer and does not work properly. It gives you the word "Array" rather than the bit.ly URL.
__________________
- Dave
http://www.dallasdancemusic.com
Reply With Quote
  #374  
Old 13 May 2010, 01:29
Bob_R Bob_R is offline
 
Join Date: Jun 2009
Originally Posted by clubplanet View Post
Great mod, thanks!

A couple of things to note:

1. Make sure you download all the PHP code. I missed the bracket at the end and got the error:
PHP Parse error: syntax error, unexpected $end in

2. Download the bitly.php file from this thread not from the URL linked in the post. The link is newer and does not work properly. It gives you the word "Array" rather than the bit.ly URL.
Got all of that. Still doesn't work. See post 372

Now it's not even going to my bit.ly.
Reply With Quote
  #375  
Old 13 May 2010, 02:38
Sparrow-Sean Sparrow-Sean is offline
 
Join Date: May 2010
Real name: Sean Bowtell
Seems to work fine with the latest vBulletin and I followed the correct procedures
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 08:20.

Layout Options | Width: Wide Color: