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

  #406  
Old 03 Jun 2010, 16:54
iguano iguano is offline
 
Join Date: May 2009
Originally Posted by michelle86 View Post
Had to uninstall this. Everytime I would create a new post, I would try to reload the page, and it would give me a database error which would last for a couple minutes until I was able to successfully view the page.
see this:

Originally Posted by imported_nimbus View Post

Let me share my solution.

bitly.php:
I set the following Curl options:
$options[CURLOPT_FOLLOWLOCATION] = false;
$options[CURLOPT_HEADER] = false;

and for twitter.php:
$options[CURLOPT_FOLLOWLOCATION] = false;

After this, works to me
Reply With Quote
  #407  
Old 04 Jun 2010, 10:18
Michlerish's Avatar
Michlerish Michlerish is offline
 
Join Date: May 2010
This is really awesome, thank you.
Reply With Quote
  #408  
Old 07 Jun 2010, 07:59
sportsbuddys's Avatar
sportsbuddys sportsbuddys is offline
 
Join Date: May 2010
Works great! Very nice hack
Reply With Quote
  #409  
Old 07 Jun 2010, 21:09
cbehan cbehan is offline
 
Join Date: Feb 2009
OK, I followed the instructions, and the process is creating the bit.ly link and the twitter post with the link, but there's no thread title information or thread ID in the link or twitter post.

That has to be something with the plugin, correct?
Reply With Quote
  #410  
Old 08 Jun 2010, 12:35
JHUMON JHUMON is offline
 
Join Date: Aug 2008
not its working nice.Thanks
__________________
www.hostsaller.com Hosting Service
www.forum4phone.com Gsm Community
Reply With Quote
  #411  
Old 08 Jun 2010, 13:43
pant pant is offline
 
Join Date: Mar 2010
There's a better mod available that is easier to install and has lots of lovely options.
Reply With Quote
  #412  
Old 08 Jun 2010, 13:52
giorgino giorgino is offline
 
Join Date: Dec 2009
Originally Posted by pant View Post
There's a better mod available that is easier to install and has lots of lovely options.
link?
Reply With Quote
  #413  
Old 08 Jun 2010, 14:00
xabo xabo is offline
 
Join Date: Apr 2010
Hello

Im getting this error when posting in my forum:

Fatal error: Call to undefined method Twitter::updateStatus() in /home/raverno/public_html/oddseksperten.no/newthread.php(273) : eval()'d code on line 26

Any clue?
Reply With Quote
  #414  
Old 08 Jun 2010, 14:49
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Originally Posted by xabo View Post
Fatal error: Call to undefined method
That's a new one. You sure you uploaded the classes files to the right place?

BTW, Twitter is changing authorization at the end of the month and this mod is presumably going to stop working then.
Reply With Quote
  #415  
Old 08 Jun 2010, 22:15
pant pant is offline
 
Join Date: Mar 2010
Originally Posted by giorgino View Post
link?
http://www.vbulletin.org/forum/showthread.php?t=236278
Reply With Quote
  #416  
Old 09 Jun 2010, 00:45
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Real name: Mosh Shigdar
Originally Posted by Videx View Post
BTW, Twitter is changing authorization at the end of the month and this mod is presumably going to stop working then.
Yes, Videx is correct, this hack will stop working, the same as with my version.
__________________
-- The WS Spiders List is still downloadable from vBulletin.com.
-- As of Monday 1st July 2013, I will no longer be supporting my hacks as I am leaving the vBulletin community due to medical and life-style reasons.
Reply With Quote
  #417  
Old 09 Jun 2010, 09:29
pant pant is offline
 
Join Date: Mar 2010
Would it not be fairly easy for a coder to get it working again?
Reply With Quote
  #418  
Old 14 Jun 2010, 11:26
ragtek's Avatar
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Is there any working add-on for vB4?
__________________
my addons: http://ragtek.github.com
Reply With Quote
  #419  
Old 14 Jun 2010, 13:40
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Originally Posted by ragtek View Post
Is there any working add-on for vB4?
You mean like the one linked 3 posts above yours?

Note that this whole thing is very dependent on lots of server settings and some people have been unable to get it working.
Reply With Quote
  #420  
Old 15 Jun 2010, 05:57
CRDeveloper's Avatar
CRDeveloper CRDeveloper is offline
 
Join Date: Aug 2009
Real name: Pablo X.
Tonight i started getting this error after new threads:


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

The tweets still working but what about that??

I red about this mod and the other one will stop working, so is twitter.com already making changes???

Whats up with this mod http://www.vbulletin.org/forum/showthread.php?t=216346 ?
That one uses OAuth authentication but for 3.8.x boards...

Anyways im confuse, im gonna have to uninstall this mod since it will stop working and tell my users to tweet them selfs haha
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 21:10.

Layout Options | Width: Wide Color: