vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   New Posting Features - WS vBulletin Tweet Poster (https://vborg.vbsupport.ru/showthread.php?t=236278)

tokenyank 01-31-2011 02:10 PM

Hi Mosh - Quick question in hopes this is in scope of your support!

I've just installed YOURLS on a 4 letter domain I managed to get to create my own shortening service as shortening services die, I'd rather run my own to ensure that links in the wild are maintained rather than 404'd.

YOURLS doesn't require auth and allows a get/post api call to access the service:
Quote:

Secure passwordless API call

YOURLS allows API calls the old fashioned way, using username and password parameters. If you're worried about sending your credentials into the wild, you can also make API calls without using your login or your password, using a secret signature token.

Your secret signature token: <SECRET API EDITED OUT> (It's a secret. Keep it secret)

This signature token can only be used with the API, not with the admin interface.

*
Usage of the signature token

Simply use parameter signature in your API requests. Example:

http://mums.ws/yourls-api.php?signature=<SECRET API EDITED OUT>&action=...

I've just tried to add the service into your mod and not working - I'm hoping you might be able to shed a bit of light on the subject?

What I've done is changed all instances of the cURL from:
Code:

elseif ($vbulletin->options['ms_vbtwitter_use_url_shortening'] == 3)
                        {
                                $tinyurl = curl_init();
                                curl_setopt($tinyurl, CURLOPT_URL, 'http://tinyurl.com/api-create.php?url=' .  $baseURL);
                                curl_setopt($tinyurl, CURLOPT_RETURNTRANSFER, 1);
                                $shortURL = curl_exec($tinyurl);
                                curl_close($tinyurl);
                        }
                        else
                        {
                                $metamark = curl_init();
                                curl_setopt($metamark, CURLOPT_URL, 'http://metamark.net/api/rest/simple?long_url=' .  $baseURL);
                                curl_setopt($metamark, CURLOPT_RETURNTRANSFER, 1);
                                $shortURL = curl_exec($metamark);
                                curl_close($metamark);
                        }

to:
Code:

elseif ($vbulletin->options['ms_vbtwitter_use_url_shortening'] == 4)
                        {
                                $metamark = curl_init();
                                curl_setopt($metamark, CURLOPT_URL, 'http://metamark.net/api/rest/simple?long_url=' .  $baseURL);
                                curl_setopt($metamark, CURLOPT_RETURNTRANSFER, 1);
                                $shortURL = curl_exec($metamark);
                                curl_close($metamark);
                        }
                        else
                        {
                                $mums = curl_init();
                                curl_setopt($mums, CURLOPT_URL, 'http://mums.ws/yourls-api.php?signature=<SECRET API EDITED OUT>&action=' .  $baseURL);
                                curl_setopt($mums, CURLOPT_RETURNTRANSFER, 1);
                                $shortURL = curl_exec($mums);
                                curl_close($mums);
                        }

And the piped from:
Code:

<optioncode>select:piped
0|No url shortening
1|bit.ly url shortening
2|is.gd url shortening
3|TinyURL url shortening
4|Metamark url shortening</optioncode>

to:
Code:

<optioncode>select:piped
0|No url shortening
1|bit.ly url shortening
2|is.gd url shortening
3|TinyURL url shortening
4|Metamark url shortening
5|mums url shortening</optioncode>

XML imports without problem, settings store with no problem, and NEWTHREAD creation without problem - however it doesn't Tweet the new thread to Twitter.

I'm not a php guru, but from going through your mod, it seemed to me that is was all I needed to change however since it is failing, I guess I was wrong...

Could you perhaps either help me get this working or add a provision in the next update to allow installations of YOURLS to be handled for those of us who want to use our own shorteners?

Thanks Mosh, I apprecaite your help in advance!

8thos 02-01-2011 02:56 AM

Works great!!!

pete_brady 02-01-2011 05:42 AM

Quote:

Originally Posted by tokenyank (Post 2156906)
a provision in the next update to allow installations of YOURLS to be handled for those of us who want to use our own shorteners?

Thanks Mosh, I apprecaite your help in advance!

this would indeed be awesome

Mosh 02-01-2011 10:32 AM

Quote:

Originally Posted by tokenyank (Post 2156906)
Hi Mosh - Quick question in hopes this is in scope of your support!

I've just installed YOURLS on a 4 letter domain I managed to get to create my own shortening service as shortening services die, I'd rather run my own to ensure that links in the wild are maintained rather than 404'd.

YOURLS doesn't require auth and allows a get/post api call to access the service:


I've just tried to add the service into your mod and not working - I'm hoping you might be able to shed a bit of light on the subject?

What I've done is changed all instances of the cURL from:
Code:

elseif ($vbulletin->options['ms_vbtwitter_use_url_shortening'] == 3)
                        {
                                $tinyurl = curl_init();
                                curl_setopt($tinyurl, CURLOPT_URL, 'http://tinyurl.com/api-create.php?url=' .  $baseURL);
                                curl_setopt($tinyurl, CURLOPT_RETURNTRANSFER, 1);
                                $shortURL = curl_exec($tinyurl);
                                curl_close($tinyurl);
                        }
                        else
                        {
                                $metamark = curl_init();
                                curl_setopt($metamark, CURLOPT_URL, 'http://metamark.net/api/rest/simple?long_url=' .  $baseURL);
                                curl_setopt($metamark, CURLOPT_RETURNTRANSFER, 1);
                                $shortURL = curl_exec($metamark);
                                curl_close($metamark);
                        }

to:
Code:

elseif ($vbulletin->options['ms_vbtwitter_use_url_shortening'] == 4)
                        {
                                $metamark = curl_init();
                                curl_setopt($metamark, CURLOPT_URL, 'http://metamark.net/api/rest/simple?long_url=' .  $baseURL);
                                curl_setopt($metamark, CURLOPT_RETURNTRANSFER, 1);
                                $shortURL = curl_exec($metamark);
                                curl_close($metamark);
                        }
                        else
                        {
                                $mums = curl_init();
                                curl_setopt($mums, CURLOPT_URL, 'http://mums.ws/yourls-api.php?signature=<SECRET API EDITED OUT>&action=' .  $baseURL);
                                curl_setopt($mums, CURLOPT_RETURNTRANSFER, 1);
                                $shortURL = curl_exec($mums);
                                curl_close($mums);
                        }

And the piped from:
Code:

<optioncode>select:piped
0|No url shortening
1|bit.ly url shortening
2|is.gd url shortening
3|TinyURL url shortening
4|Metamark url shortening</optioncode>

to:
Code:

<optioncode>select:piped
0|No url shortening
1|bit.ly url shortening
2|is.gd url shortening
3|TinyURL url shortening
4|Metamark url shortening
5|mums url shortening</optioncode>

XML imports without problem, settings store with no problem, and NEWTHREAD creation without problem - however it doesn't Tweet the new thread to Twitter.

I'm not a php guru, but from going through your mod, it seemed to me that is was all I needed to change however since it is failing, I guess I was wrong...

Could you perhaps either help me get this working or add a provision in the next update to allow installations of YOURLS to be handled for those of us who want to use our own shorteners?

Thanks Mosh, I apprecaite your help in advance!

I will look into this at the weekend and we shall see. However, I am not promising anything at this stage... so, you will have to wait and see.

tokenyank 02-01-2011 10:33 AM

That's all a guy can ask for! Thanks Mosh!

GooWood 02-04-2011 02:12 AM

This is the 2nd thread to tweet mod i have used. Had problems at the start figured it out thankfully. Nothing to do with this mod. There was a left over bit of code from the old mod that didn't:up: work. I have to say I love this thread and it will be helping me out a lot with the news on my site. So thank you and once again wonderful addon. :up:

demonfatal 02-05-2011 02:57 AM

For any reason I am not able to get it working with vB4.1.1
I tried a lot of times and no success all seem set correctly...
I am confused, Mosh can you assist by PM please?

Mosh 02-05-2011 04:43 AM

Quote:

Originally Posted by demonfatal (Post 2158937)
For any reason I am not able to get it working with vB4.1.1
I tried a lot of times and no success all seem set correctly...
I am confused, Mosh can you assist by PM please?

I do not provide support via PM (see the first post for more information), and I also do not provide support for people who have not clicked Mark as Installed.

demonfatal 02-05-2011 03:43 PM

Quote:

Originally Posted by Mosh (Post 2158951)
I do not provide support via PM (see the first post for more information), and I also do not provide support for people who have not clicked Mark as Installed.

I uninstalled it since I was not able to get it working...
But I clicked installed now...can you help please?

Mosh 02-05-2011 09:02 PM

Quote:

Originally Posted by demonfatal (Post 2159079)
I uninstalled it since I was not able to get it working...
But I clicked installed now...can you help please?

Lets start by you telling me where it is failing, be as detailed as possible, because without knowing where the problems are occurring I can not begin to troubleshoot your issue.


All times are GMT. The time now is 01:22 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.01906 seconds
  • Memory Usage 1,774KB
  • 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
  • (8)bbcode_code_printable
  • (6)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