vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Miscellaneous Hacks - vBulletin to Twitter, live tweets of new threads (https://vborg.vbsupport.ru/showthread.php?t=234288)

steeler7 02-18-2010 02:34 AM

Anyone who had issues with Bit.ly ... figure out how to resolve that issue? I want to sue this Mod so bad but my url's are really long without being shortened

lhridley 02-18-2010 02:42 AM

Quote:

I want to sue this Mod so bad but my url's are really long without being shortened
Um....do you mean "use" and not "sue"?

lhridley 02-18-2010 02:45 AM

I've been really surprised at the number of people posting about issues with Bit.ly. It took me all of five minutes to set up my account with them and get that working. I've had many more issues with the mod itself.

For example, it doesn't check to see if the title of a thread exceeds the 140 character length allowed for a tweet -- this causes an Exception error to be thrown that's not captured and handled anywhere -- which is fine for a programmer ,but doesn't really help an end user when they see a screen dump of gobbledygook in response to submitting a thread with a long title.

:/

puppetmaster222 02-18-2010 02:51 AM

Simple and effective. I had no problems getting it to work right out of the gate, thanks.

steeler7 02-18-2010 03:33 AM

Quote:

Originally Posted by lhridley (Post 1985232)
Um....do you mean "use" and not "sue"?

Ah yes... I meant "use" . sorry about that

Netaudio 02-18-2010 09:32 AM

Hi,

after posting:

Quote:

invalid body on line 660 in /var/www/web5/html/vb3/twitter.php
#0 /var/www/web5/html/vb3/newthread.php(262) : eval()'d code(26): Twitter->updateStatus('24.04.2010 - 4 ...')
#1 /var/www/web5/html/vb3/newthread.php(262): eval()
#2 /var/www/web5/html/vb3/vbseo.php(1629): require('/var/www/web5/h...')
#3 {main}
How can i fix it?

V8Owner 02-18-2010 12:33 PM

Downloaded, installed & tweeting away.

Thanks :) :D

LbR 02-18-2010 01:12 PM

Quote:

Originally Posted by Videx (Post 1981794)
This has been covered; it's a server issue. You need to read this entire thread.

oh my holy god, any symptoms of page number can help me from several blood pressure problems

Pro-eSports.com 02-18-2010 03:23 PM

Do I have to enter the sub-forum ID's too or are the main forum ID's enough?
Do category ID's work too?

Hateman 02-18-2010 03:39 PM

Hello,

i got this error:



Warnung: 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 (Zeile 141)
{ "errorCode": 0, "errorMessage": "", "results": { "http://forum.mydomain.de/showthread.php?t=3680": { "hash": "dAunjV", "shortCNAMEUrl": "http://bit.ly/9857Z4", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/9857Z4", "userHash": "9857Z4" } }, "statusCode": "OK" }Invalid JSON-response on line 196 in /var/www/virtual/mydomain.de/forum/htdocs/bitly.php
#0 /var/www/virtual/mydomain.de/forum/htdocs/bitly.php(382): Bitly->doCall('shorten', Array)
#1 /var/www/virtual/mydomain.de/forum/htdocs/newthread.php(262) : eval()'d code(14): Bitly->shorten('http://forum.em...')
#2 /var/www/virtual/mydomain.de/forum/htdocs/newthread.php(262): eval()
#3 /var/www/virtual/mydomain.de/forum/htdocs/vbseo.php(1629): require('/var/www/virtua...')
#4 {main}


Schwerer Fehler: Invalid JSON-response on line 196 in [path]/bitly.php in [path]/vb/vb.php (Zeile 284)
#0 vb_error_handler(256, Invalid JSON-response on line 196 in /var/www/virtual/mydomain.de/forum/htdocs/bitly.php , /var/www/virtual/mydomain.de/forum/htdocs/vb/vb.php, 284, Array ([exception] => BitlyException Object ([] => Invalid JSON-response,[] => ,[] => 0,[] => /var/www/virtual/mydomain.de/forum/htdocs/bitly.php,[] => 196,[] => Array ([0] => Array ([file] => /var/www/virtual/mydomain.de/forum/htdocs/bitly.php,[line] => 382,[function] => doCall,[class] => Bitly,[type] => ->,[args] => Array ([0] => shorten,[1] => Array ([longUrl] => http://forum.mydomain.de/showthread.php?t=3680,[history] => 1))),[1] => Array ([file] => /var/www/virtual/mydomain.de/forum/htdocs/newthread.php(262) : eval()'d code,[line] => 14,[function] => shorten,[class] => Bitly,[type] => ->,[args] => Array ([0] => http://forum.mydomain.de/showthread.php?t=3680)),[2] => Array ([file] => /var/www/virtual/mydomain.de/forum/htdocs/newthread.php,[line] => 262,[function] => eval),[3] => Array ([file] => /var/www/virtual/mydomain.de/forum/htdocs/vbseo.php,[line] => 1629,[args] => Array ([0] => /var/www/virtual/mydomain.de/forum/htdocs/newthread.php),[function] => require))),[code] => 256)) called at [(null):0] #1 trigger_error(Invalid JSON-response on line 196 in /var/www/virtual/mydomain.de/forum/htdocs/bitly.php , 256) called at [/var/www/virtual/mydomain.de/forum/htdocs/vb/vb.php:284] #2 vB::handleException(BitlyException Object ([] => Invalid JSON-response,[] => ,[] => 0,[] => /var/www/virtual/mydomain.de/forum/htdocs/bitly.php,[] => 196,[] => Array ([0] => Array ([file] => /var/www/virtual/mydomain.de/forum/htdocs/bitly.php,[line] => 382,[function] => doCall,[class] => Bitly,[type] => ->,[args] => Array ([0] => shorten,[1] => Array ([longUrl] => http://forum.mydomain.de/showthread.php?t=3680,[history] => 1))),[1] => Array ([file] => /var/www/virtual/mydomain.de/forum/htdocs/newthread.php(262) : eval()'d code,[line] => 14,[function] => shorten,[class] => Bitly,[type] => ->,[args] => Array ([0] => http://forum.mydomain.de/showthread.php?t=3680)),[2] => Array ([file] => /var/www/virtual/mydomain.de/forum/htdocs/newthread.php,[line] => 262,[function] => eval),[3] => Array ([file] => /var/www/virtual/mydomain.de/forum/htdocs/vbseo.php,[line] => 1629,[args] => Array ([0] => /var/www/virtual/mydomain.de/forum/htdocs/newthread.php),[function] => require)))) called at [(null):0]

Best regards

steeler7 02-18-2010 04:33 PM

Quote:

Originally Posted by lhridley (Post 1985238)
I've been really surprised at the number of people posting about issues with Bit.ly. It took me all of five minutes to set up my account with them and get that working. I've had many more issues with the mod itself.

For example, it doesn't check to see if the title of a thread exceeds the 140 character length allowed for a tweet -- this causes an Exception error to be thrown that's not captured and handled anywhere -- which is fine for a programmer ,but doesn't really help an end user when they see a screen dump of gobbledygook in response to submitting a thread with a long title.

:/

Was there something that needed to be done at bit.ly that I missed? Threads from my board are going to bit.ly and can be seen on the "home" section of my account. If I click "share" it'll send it to my Twitter account with no problems... I obviiously have the Twitter account set up at bit.ly or I wouldn't be able to share it.... It seems like there's something that's not having it automatically go to Twitter.

sqzdog 02-18-2010 04:45 PM

I am missing the response, or the author has not responded.

My board is not a heavy use board so I want to be able to tweet EVERY POST, not just new threads.

Can this be done?

sqzdog 02-18-2010 04:49 PM

Steeler7, did you check to make sure you included your twitter url in the plugin you created?

steeler7 02-18-2010 06:07 PM

Quote:

Originally Posted by sqzdog (Post 1985716)
Steeler7, did you check to make sure you included your twitter url in the plugin you created?

Here's my code... I've looked over it a bunch of times maybe you can see something I screwed up...

PHP Code:

// The array below are the ids of non-public forums, update these to be your admin forum ids or anything non-public by default
$excludedForums = array(1,2,3,35,36,37,38,39,40,43);

// If you are having trouble getting bitly URL shortening to work... disable it!
$useBitly true;

if (!
in_array($foruminfo[forumid], $excludedForums)) {
    
$shortUrl 'http://www.pittsburghsportstavern.com/forum/showthread.php?t='.$newpost[threadid];

    if (
$useBitly) {
      
// http://classes.verkoyen.eu/bitly
      
require_once 'bitly.php';
      
$bitly = new Bitly('kipper51''R_**************');
      
$shortUrl $bitly->shorten($shortUrl);
    }

    
$tweet '';
    if (isset(
$newpost['prefixid']) && $newpost['prefixid'] != '') {
        
$tweet $vbphrase['prefix_'.$newpost['prefixid'].'_title_plain'].' ';
    }
    
$tweet .= $newpost['title'].' '.$shortUrl;

    
// http://classes.verkoyen.eu/twitter/
    
require_once 'twitter.php';
    
$twitter = new Twitter('pghsportstavern','********');
    
$twitter->updateStatus($tweet);



sqzdog 02-18-2010 06:25 PM

Yours looks identical to mine except for the forum exclusions. I put a space after each comma. Don't know if that would even affect it.

Pro-eSports.com 02-18-2010 07:06 PM

Quote:

Originally Posted by Pro-eSports.com (Post 1985670)
Do I have to enter the sub-forum ID's too or are the main forum ID's enough?
Do category ID's work too?

I also have another question. I only want to tweet a few of my forums, is there a code that instead of the excluded forums I can enter the included forums? Would be easier for a site with many forums.

steeler7 02-18-2010 07:18 PM

does this need a specific version of php? Im using 5.1.6 and couldn't use the Tweet Poster mod because it required php 5.2.3 or higher.

just curious

Majora 02-18-2010 07:21 PM

what do I have to insert after

PHP Code:

// loop parameters and add them to the queryString
            
foreach($aParameters as $key => $value$queryString .= '&'$key .'='urlencode(utf8_encode($value)); 

to rewrite ??? etc...

Best regards,
Majora

sqzdog 02-18-2010 07:24 PM

Quote:

does this need a specific version of php? Im using 5.1.6 and couldn't use the Tweet Poster mod because it required php 5.2.3 or higher.
just curious

I don't know. I'm running 5.2.8

steeler7 02-18-2010 07:41 PM

Quote:

Originally Posted by sqzdog (Post 1985855)
just curious

I don't know. I'm running 5.2.8

Hmmm...

anyone else running php 5.1.6 or lower? I'm talking with my host to upgrade but they said something about conflicts with plesk being an issue (I think they're trying to scare me off from forcing them to do work..lol)

Pro-eSports.com 02-18-2010 07:48 PM

I got this error message after submitting a thread:

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 on line 141
{ "errorCode": 0, "errorMessage": "", "results": { "http://www.pro-esports.com/showthread.php?t=22": { "hash": "d6TEBY", "shortCNAMEUrl": "http://bit.ly/cn4qlP", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/cn4qlP", "userHash": "cn4qlP" } }, "statusCode": "OK" }Invalid JSON-response on line 196 in /.../pro-esports.com/forums/bitly.php
#0 /.../pro-esports.com/forums/bitly.php(382): Bitly->doCall('shorten', Array)
#1 /.../pro-esports.com/forums/newthread.php(262) : eval()'d code(19): Bitly->shorten('http://www.pro-...')
#2 /.../pro-esports.com/forums/newthread.php(262): eval()
#3 {main}

Fatal error: Invalid JSON-response on line 196 in [path]/bitly.php in [path]/vb/vb.php on line 284
#0 vb_error_handler(256, Invalid JSON-response on line 196 in /.../pro-esports.com/forums/bitly.php , /.../pro-esports.com/forums/vb/vb.php, 284, Array ([exception] => BitlyException Object ([] => Invalid JSON-response,[] => ,[] => 0,[] => /.../pro-esports.com/forums/bitly.php,[] => 196,[] => Array ([0] => Array ([file] => /.../pro-esports.com/forums/bitly.php,[line] => 382,[function] => doCall,[class] => Bitly,[type] => ->,[args] => Array ([0] => shorten,[1] => Array ([longUrl] => http://www.pro-esports.com/showthread.php?t=22,[history] => 1))),[1] => Array ([file] => /.../pro-esports.com/forums/newthread.php(262) : eval()'d code,[line] => 19,[function] => shorten,[class] => Bitly,[type] => ->,[args] => Array ([0] => http://www.pro-esports.com/showthread.php?t=22)),[2] => Array ([file] => /.../pro-esports.com/forums/newthread.php,[line] => 262,[function] => eval))),[code] => 256)) #1 trigger_error(Invalid JSON-response on line 196 in /.../pro-esports.com/forums/bitly.php , 256) called at [/.../pro-esports.com/forums/vb/vb.php:284] #2 vB::handleException(BitlyException Object ([] => Invalid JSON-response,[] => ,[] => 0,[] => /.../pro-esports.com/forums/bitly.php,[] => 196,[] => Array ([0] => Array ([file] => /.../pro-esports.com/forums/bitly.php,[line] => 382,[function] => doCall,[class] => Bitly,[type] => ->,[args] => Array ([0] => shorten,[1] => Array ([longUrl] => http://www.pro-esports.com/showthread.php?t=22,[history] => 1))),[1] => Array ([file] => /.../pro-esports.com/forums/newthread.php(262) : eval()'d code,[line] => 19,[function] => shorten,[class] => Bitly,[type] => ->,[args] => Array ([0] => http://www.pro-esports.com/showthread.php?t=22)),[2] => Array ([file] => /.../pro-esports.com/forums/newthread.php,[line] => 262,[function] => eval))))


I got rid of the red code after changing from "true" to "false". The first error message is a problem which you explained in your mod post but I don't know where to add the code from there. It says on line 136 but the code only has about 30 lines. :S

steeler7 02-19-2010 01:31 AM

Ok... I had my host upgrade my PHP. I'm now running 5.2.12 . I have curl, json enabled, I have Mcrypt (which was a requirement for another twitter mod)..

This is what I get now when I post a thread...



{ "errorCode": 0, "errorMessage": "", "results": { "http://www.pittsburghsportstavern.com/forum/showthread.php?t=3106": { "hash": "ccJT9V", "shortCNAMEUrl": "http://bit.ly/d5LAZT", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/d5LAZT", "userHash": "d5LAZT" } }, "statusCode": "OK" }




That code is now on the white screen. Post still goes through on the forum, makes its way to Bit.ly, doesn't get to Twitter

Pro-eSports.com 02-19-2010 12:40 PM

For some reason I still get this error after adding the code on line 136 in the bitly.php file.

Code:

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 on line 141
{ "errorCode": 0, "errorMessage": "", "results": { "http://www.pro-esports.com/showthread.php?t=22": { "hash": "d6TEBY", "shortCNAMEUrl": "http://bit.ly/cn4qlP", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/cn4qlP", "userHash": "cn4qlP" } }, "statusCode": "OK" }Invalid JSON-response on line 196 in /.../pro-esports.com/forums/bitly.php
#0 /.../pro-esports.com/forums/bitly.php(382): Bitly->doCall('shorten', Array)
#1 /.../pro-esports.com/forums/newthread.php(262) : eval()'d code(19): Bitly->shorten('http://www.pro-...')
#2 /.../pro-esports.com/forums/newthread.php(262): eval()
#3 {main}


sqzdog 02-20-2010 03:28 AM

Steelers7 and others- I have deleted this mod and installed a new one that was just released here: https://vborg.vbsupport.ru/showthread.php?t=236278

Much easier to configure and lets you tweet post replies as well. I set it up on my 2 sites with no problems. If you need help, let me know.

-Gary

Xboxinsider 02-21-2010 05:17 PM

Is there anyway to make it put some like "New forum thread:" before each twitter post? I find im loosing follows, probably because they think it's spam? Cheers! Otherwise, it's a great mod!

Bob_R 02-21-2010 05:27 PM

Any way to get replies to be tweeted?

pericolosogr 02-23-2010 06:56 AM

Tried everything went many times through the thread, everything is enabled from my servers side, kept getting JSON issues and then twitter auth problems!

Uninstalled and total waste of time for me!

Oasismad 02-23-2010 10:58 AM

is there anyway of adding a #hashtag prefix so that

Code:

Barnsley FC v Blackpool 27/02/2010 Match Thread - http://bit.ly/bD0SKL #Barnsley Football Club
etc

masons 02-23-2010 02:04 PM

I got all working, no errors!
but..
No tweets! So I guess not all working after all!

Videx 02-25-2010 03:37 PM

Well, I finally got around to hacking the heck out of it and here's my version that uses is.gd instead of bit.ly (which I could never get to work). A shame there isn't some way to test this besides LIVE.
PHP Code:

// The array below are the ids of non-public forums, update these to be your admin forum ids or anything non-public by default
$excludedForums = array(0);

if (!
in_array($foruminfo[forumid], $excludedForums)) {
    
$myUrl 'http://www.myforum.com/forum/showthread.php?t='.$newpost[threadid];
    
    
$cURL_resource curl_init();
    
curl_setopt($cURL_resourceCURLOPT_URL'http://is.gd/api.php?longurl=' .  $myUrl);
    
curl_setopt($cURL_resourceCURLOPT_RETURNTRANSFER1);
    
$shortUrl curl_exec($cURL_resource); 
    
curl_close($cURL_resource);
        
    
$tweet '';
    if (isset(
$newpost['prefixid']) && $newpost['prefixid'] != '') {
        
$tweet $vbphrase['prefix_'.$newpost['prefixid'].'_title_plain'].' ';
    }
    
$tweet .= $newpost['title'].' '.$shortUrl;

    
// http://classes.verkoyen.eu/twitter/
    
require_once 'twitter.php';
    
$twitter = new Twitter('MyTwitterName','MyTwitterPassword');
    
$twitter->updateStatus($tweet);



Vanjezi 02-25-2010 05:09 PM

Respect! 5 stars, works just great :)

Mosh 02-25-2010 06:44 PM

Quote:

Originally Posted by Videx (Post 1991331)
Well, I finally got around to hacking the heck out of it and here's my version that uses is.gd instead of bit.ly (which I could never get to work). A shame there isn't some way to test this besides LIVE.
PHP Code:

// The array below are the ids of non-public forums, update these to be your admin forum ids or anything non-public by default
$excludedForums = array(0);

if (!
in_array($foruminfo[forumid], $excludedForums)) {
    
$myUrl 'http://www.myforum.com/forum/showthread.php?t='.$newpost[threadid];
    
    
$cURL_resource curl_init();
    
curl_setopt($cURL_resourceCURLOPT_URL'http://is.gd/api.php?longurl=' .  $myUrl);
    
curl_setopt($cURL_resourceCURLOPT_RETURNTRANSFER1);
    
$shortUrl curl_exec($cURL_resource); 
    
curl_close($cURL_resource);
        
    
$tweet '';
    if (isset(
$newpost['prefixid']) && $newpost['prefixid'] != '') {
        
$tweet $vbphrase['prefix_'.$newpost['prefixid'].'_title_plain'].' ';
    }
    
$tweet .= $newpost['title'].' '.$shortUrl;

    
// http://classes.verkoyen.eu/twitter/
    
require_once 'twitter.php';
    
$twitter = new Twitter('MyTwitterName','MyTwitterPassword');
    
$twitter->updateStatus($tweet);



It is great you could get it to work with is.gd using code you lifted directly out of my vBulletin2Twitter hack, so please do not claim credit for something you did not code.

Videx 02-25-2010 07:45 PM

I'm not a coder, but after hacking away with these two mods I finally got one that works for me. I made no claim to credit for anything, nor am I suggesting anyone should use mine.

Fact is, if you can fix yours I prefer the add-on approach to doing this tedious manual code mangling, so I'll probably try it again. Especially if you add some bells and whistles like forum names and summaries.

rrudeboy 03-03-2010 08:01 PM

no error.... and no tweet, anywhere (log) i can trouble shoot this ?

take that back, i replied on the forum and got this error:

Quote:

Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /hsphere/local/home/roeiboot/totalsmartphone.net/forum/bitly.php on line 34
<strike>thought the plugin would only work on NEW posts, not replies..</strike>

i had setup the incorrect Hook Location, fixed that but still get the same error..

rrudeboy 03-04-2010 11:00 AM

this thread is no longer active ? :confused:

ikastara 03-05-2010 02:40 AM

works fine !
thanks you very much!
loving this :)

Crow 03-05-2010 07:10 PM

5 stars...

GafferSports 03-07-2010 03:05 PM

Superb!

Working for me after I double checked my edits in the PHP - top work

necie_r 03-07-2010 06:16 PM

Very easy instructions. I downloaded, installed and configured it in minutes! And then I tested it. Works like a breeze! :D

GafferSports 03-07-2010 07:24 PM

One think I would like to see is this being compatible with RSS Feed threads, which it does not seem to be able to do at the moment


All times are GMT. The time now is 08:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01654 seconds
  • Memory Usage 1,887KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete