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)

sqzdog 02-11-2010 07:02 PM

I would like to know if this thing will tweet new posts INSTEAD of new threads......

Bob_R 02-11-2010 08:02 PM

I'm sorry I don't understand. I wish to have this but where do I put the aforementioned PHP code?

In bitly.php or twitter.php or elsewhere?

Bob_R 02-11-2010 08:52 PM

I actually figured out my post above.

New question: I don't get this

The shortUrl line might look like this:
$shortUrl = 'http://www.vbulletin.com/forum/showthread.php?t='.$newpost[threadid];

How do I know what to put?

Bob_R 02-12-2010 02:02 AM

My forums are not in my forum root folder. How do I proceed?

This is my error:

Warning: require_once(bitly.php) [function.require-once]: failed to open stream: No such file or directory in [path]/newthread.php(262) : eval()'d code on line 12

Fatal error: require_once() [function.require]: Failed opening required 'bitly.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxxxx/public_html/dumontnjforum.com/forums/newthread.php(262) : eval()'d code on line 12


And here's my PHP:

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(20);

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

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

    if (
$useBitly) {
      
// http://classes.verkoyen.eu/bitly
      
require_once 'bitly.php';
      
$bitly = new Bitly('bitly username''bitly API KEY');
$shortUrl $bitly->shorten('http://www.dumontnjforum.com/forums/showthread.php?t='.$newpost[threadid]);

    }

    
$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('twitter username''twitter password');
    
$twitter->updateStatus($tweet);


Can someone please give me a hand?

Bob_R 02-12-2010 02:29 AM

Actually I'm getting closer. This is what I got now. How do I fix this?
PHP code is in post above this one.

You must be authenticated to access shorten on line 193 in /home/xxxxxxx/public_html/dumontnjforum.com/forums/bitly.php
#0 /home/xxxxxxx/public_html/dumontnjforum.com/forums/bitly.php(382): Bitly->doCall('shorten', Array)
#1 /home/xxxxxxx/public_html/dumontnjforum.com/forums/newthread.php(262) : eval()'d code(14): Bitly->shorten('http://www.dumo...')
#2 /home/xxxxxxx/public_html/dumontnjforum.com/forums/newthread.php(262): eval()
#3 /home/xxxxxxx/public_html/dumontnjforum.com/forums/vbseo.php(1804): require('/home/bobbyrag/...')
#4 {main}

Warning: Invalid error type specified in [path]/vb/vb.php on line 284

Videx 02-12-2010 02:40 AM

Hey, if you get bit.ly working, let me know how!

{offtopic}
But an off topic comment from another community forum admin: You've got way too much junk on that forum. A custom theme, vbseo, even a gd arcade! All three of these by themselves can wreak havoc on vb. Not that long time admins haven't gotten them all working together (well, not in vb4 yet), but how many in your community do you really expect to hang out to play in the arcade? Are you making a forum for kids? Asking for trouble, especially if you're on a shared server.
{/offtopic}

Bob_R 02-12-2010 10:39 AM

Thanks for answering w/o an answer. :confused: Duly noted but not taken seriously because as per another community forum admin you're a shit-stirrer.

Now. Is there an answer in our future? :)

TrailRecon 02-12-2010 11:01 AM

Thanks for this mod. Easy install and workin perfectly!

My site
http://www.trail-recon.com/vforum/forum.php

The auto twitter updates
https://twitter.com/TrailRecon

thanks again!

kall 02-12-2010 01:26 PM

Quote:

Originally Posted by Bob_R (Post 1980686)
Thanks for answering w/o an answer. :confused: Duly noted but not taken seriously because as per another community forum admin you're a shit-stirrer.

Now. Is there an answer in our future? :)

Hey Bob,

Are you 100% certain that your bit.ly credentials are correct?

I thought mine were, but bit.ly for some reason carries a space with the key when you copy/paste it into the box.

(If you want, fire me a PM with your full plugin code, I won't share it with anyone, and might be able to figure it out.)

Bob_R 02-12-2010 01:58 PM

Quote:

Originally Posted by kall (Post 1980773)
Hey Bob,

Are you 100% certain that your bit.ly credentials are correct?

I thought mine were, but bit.ly for some reason carries a space with the key when you copy/paste it into the box.

(If you want, fire me a PM with your full plugin code, I won't share it with anyone, and might be able to figure it out.)

Thanks so much bro. You actually gave me an idea/something to look out for and now it works perfectly. :up:

Again, thanks for taking the time to answer. :)


All times are GMT. The time now is 09:11 PM.

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.01407 seconds
  • Memory Usage 1,755KB
  • 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
  • (1)bbcode_php_printable
  • (2)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