![]() |
|
|
Mod Options |
vBulletin to Twitter, live tweets of new threads Details »»
|
|||||||||||||||||||
|
vBulletin to Twitter, live tweets of new threads
Developer Last Online: Jul 2012
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):
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:
Download Now Only licensed members can download files, Click Here for more information. Show Your Support
No members have liked this post.
|
|||||||||||||||||||
Similar Mod
|
||||
| Mod | Developer | Type | Replies | Last Post |
| vBulletin 2 Twitter - Take Your News Straight To Twitter! | AHealthForum | vBulletin 3.8 Add-ons | 115 | 22 Feb 2013 22:02 |
|
#31
|
||||
|
||||
|
Scary. You are having fun.
In bitly.php where you have these lines:
Could you echo $response and then return; out of there so that I can see what the hell bitly returned. The JSON from them should be fine, so I want to be sure it's working at all. No members have liked this post.
|
||||
|
#32
|
||||
|
||||
|
Originally Posted by buro9
Lol, well it's a mod that will save me a lot of time, and an error was fixed, so keeping it positive!
Not to sure what to change exactly though. Tried echoing it out. But I'm getting the same error all the time, so I'm echoing out something wrong. No members have liked this post.
|
||||
|
#33
|
||||
|
||||
|
Basically this:
You need to see what is coming back before the exception gets thrown. No members have liked this post.
|
||||
|
#34
|
||||
|
||||
|
Originally Posted by buro9
Ah oke,
here we go:
No members have liked this post.
|
||||
|
#35
|
|||
|
|||
|
Strange... it's working perfectly fine.
What version of PHP are you using? No members have liked this post.
|
|
#36
|
|||
|
|||
|
Originally Posted by buro9
PHP 5.2.9
It does post as well in bit.ly, it seems to fail at connecting with twitter No members have liked this post.
|
|
#37
|
|||
|
|||
|
Originally Posted by Nordinho
I don't think it is, it errors in the bit.ly library when it tries to parse the JSON.
The JSON is fine, it's the call to deserialise it that fails. This: http://php.net/manual/en/function.json-decode.php I'll have a stab around tomorrow and see if I can figure it out. No members have liked this post.
|
|
#38
|
|||
|
|||
|
Allrighty, thanks for the help sofar!
No members have liked this post.
|
|
#39
|
|||
|
|||
|
Getting 500 internal server error, any ideas?
No members have liked this post.
Last edited by Jesh : 28 Jan 2010 at 00:20. |
|
#40
|
|||
|
|||
|
This mod is all great and I love the idea, never thought of it... but..
How exactly is it helping you get visitors to your site from those viewing your twitter page? I mean...all those threads that are relayed to twitter to be posted have no link backs to your actual vbulletin site, do they? Correct me if I'm wrong. But if it just copies threads/posts and posts it on tweeter without some sort of link back to original thread... then what's the use? Again, correct me if I'm wrong. And thanks for the mod! No members have liked this post.
|
|
#41
|
||||
|
||||
|
Originally Posted by LbR
I have the same error
No members have liked this post.
|
||||
|
#42
|
|||
|
|||
|
i was getting the You must be authenticated to access shorten on line 193 error but then realised i had a space after my api code, this was the problem so please check your bitly api codes.
working great thanks installed 5* No members have liked this post.
|
|
#43
|
|||
|
|||
|
Installed, properly inserted my bit.ly username and API key and twitter details, post does not happen. No errors, nothing. Just doesn't happen. Something wrong?
Using vB 4.0.1 w/ vbSEO. No members have liked this post.
|
|
#44
|
|||
|
|||
|
no Spaces in the API Key and username, all ceck more as 10x Times..... only the Errorcode :-(
No members have liked this post.
|
![]() |
«
Previous Mod
|
Next Mod
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Mod Options | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 14:19.








