Thread: Integration with vBulletin - vBTwitter
View Single Post
  #576  
Old 08-13-2009, 10:44 PM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rjerina View Post
I tried searching but didn't find anything, but instead of storing password or prompting for a password, how do sites like Twitpic etc authenticate? They somehow pick up your authentication to twitter and they just work, I assume with something through the API.

Forgive me if this was posted already. I am interested in this but don't want to store any passwords unencrypted if possible and very little use integration.
Well, this doesn't prompt for a password. And twit pic, does. If you go to their site, they prompt for a username / password.

Quote:
Originally Posted by johnbmtl View Post
When I click on the link in th euser options "Setup integration by clicking here."

I get the following from the twitter site:

Woah there!
This page is no longer valid. It looks like someone already used the token information you provided. Please return to the site that sent you to this page and try again ? it was probably an honest mistake.

Did I miss something in the installation?

------------------
Update: Yes I did miss something in the installation.
The instructions to register an OAuth Application which appear under the Upgrading instructions also apply to new installations.

Everything works fine now.
Guess I missed something their. *wonders why I screwed that up*.

Quote:
Originally Posted by ClipBucket View Post
To post the title for threads to Twitter, edit tweet.php
Find the section that starts with:

PHP Code:
if($_GET['do'] == 'thread')


Find:

PHP Code:
$twitter->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' => $vbphrase['twitter_checkout'] . $vbulletin->options['bburl'] . '/tt.php?i=' $vbulletin->GPC['id']), 'POST'); 

Change to:

PHP Code:
$thread $db->query_first("SELECT title FROM " TABLE_PREFIX "thread WHERE threadid = " $vbulletin->GPC['id']);
$twitter->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' => $thread['title'] .' - '$vbulletin->options['bburl'] . '/tt.php?i=' $vbulletin->GPC['id']), 'POST'); 

This only works when Twittering a thread.
I have not looked into sending post titles yet, though it should also be trivial.
Quote:
Originally Posted by ClipBucket View Post
This is not tested.

To post the title for posts to Twitter, edit tweet.php
Find the section that starts with:

PHP Code:
if($_GET['do'] == 'post')


Find:

PHP Code:
$twitter->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' => $thread['title'] .' - '$vbulletin->options['bburl'] . '/tp.php?i=' $vbulletin->GPC['id'] . '&c=' $vbulletin->GPC['c']), 'POST'); 

Change to:

PHP Code:
        $post $db->query_first("SELECT title FROM " TABLE_PREFIX "post WHERE postid = " $vbulletin->GPC['id']);
        
$twitter->OAuthRequest('https://twitter.com/statuses/update.xml', array('status' => $post['title'] .' - '$vbulletin->options['bburl'] . '/tp.php?i=' $vbulletin->GPC['id'] . '&c=' $vbulletin->GPC['c']), 'POST'); 
I thank you for writing this, but it has the problems within itself. It doesn't do character checking. Which is what I have done extensively for the next version.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01333 seconds
  • Memory Usage 1,817KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete