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-15-2010 03:41 PM

Quote:

Originally Posted by kall (Post 1983029)
Does it make it to Twitter?

Have you checked your error_log to see if that sheds light on the white page issue? I'd guess out of memory, but that is a total stab in the dark.

It doesn't make it to Twitter.

Sorry it took me a few minutes i went into my server to download the error log and look through. Couldn't find anything

Hateman 02-15-2010 04:05 PM

Quote:

Originally Posted by kall (Post 1982981)
Hello Penelope,

What is the content of your plugin?

If you filled it in correctly, that error does not occur.

Hi there,

here is my code=

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(59,64);

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

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

    if ($useBitly) {
      // http://classes.verkoyen.eu/bitly
      require_once 'bitly.php';
      $bitly = new Bitly('BITLYNAME', 'R_APIKEY');
      $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('MYTWITTERNAME','MYPASSWORD'


steeler7 02-15-2010 04:48 PM

I noticed while logged into my bitly account that the 2 test threads I had tried are being shown on the "Home" section. They just never went from bitly to Twitter. I have the correct Twitter information submitted to bitly. Is there something else I'm supposed to do?

kall 02-15-2010 05:09 PM

Quote:

Originally Posted by Hateman (Post 1983075)
Hi there,

here is my code=

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(59,64);

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

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

    if ($useBitly) {
      // http://classes.verkoyen.eu/bitly
      require_once 'bitly.php';
      $bitly = new Bitly('BITLYNAME', 'R_APIKEY');
      $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('MYTWITTERNAME','MYPASSWORD'


You're missing a chunk of code.

PHP Code:

);
       
$twitter->updateStatus($tweet);



wolfyman 02-15-2010 08:39 PM

it just started working.

I have no idea why, but it did. :rolleyes:

steeler7 02-16-2010 12:19 AM

Ok... I basically disabled bit.ly by changing the variable from true to false, did a test thread post and it went straight to Twitter, no white screen or anything. worked nice except for the super long Link.

So, I've narrowed the problem down to being a bit.ly issue and I remember reading in this thread where others had the same issue. did anyone figure out a way to solve this?

lhridley 02-16-2010 12:20 AM

Well, shoot. Now the bitly link to replies takes users to the "page not found" page on vBulletin. So, I don't have the replies piece working after all (however, the new threads component works great).

Anyone else get replies tweets working?

icarusforde 02-16-2010 01:42 AM

Quote:

Originally Posted by Videx (Post 1982823)
First, you could just disable bitly (change $useBitly= ; to false). In the above code I see the <> signs included in both your keys; they aren't supposed to be.

Ah, always the obvious ones that nail me. >.<

Call myself a coder and i don't find the right thing to fix my own screwups. xD

I'll try it *without* them now. :D

Edit: Thanks, this worked for me. :P

I also figured out why it wouldn't go away even when i disabled the plugin... I'd edited another plugin by another name by mistake and it had the screwed up code in it. :P

jandb 02-16-2010 03:35 AM

If you are having problems with not being authorised make sure you don't have a extra space after your API key before the last ' . This worked for me and everything is running fine now.

steeler7 02-16-2010 04:54 AM

I've tried everything within my ability. Re-copied code and started from scratch, I reset the API key and put it in (no blank space at the end).

If I have bit.ly turned on, I get a blank screen, no errors that I can find. The post/thread goes through. I have to hit the back button and view the forum to see the thread. It doesn't go to Twitter, it shows up at Bit.ly. It gets listed, has a shortened URL that can posted to Twitter. If I choose that, it goes there just fine.... If I turn off Bit.ly, the new Thread goes through to Twitter with no problems and no white screen. I just have a really long URL


All times are GMT. The time now is 09:28 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.01456 seconds
  • Memory Usage 1,751KB
  • 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
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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