-
AuthorPosts
-
February 27, 2012 at 11:19 am #4544peppelinGuest
Hi, I’ve been using wp spocializer and works like a cham.
The only thing I found not working as intended is the 16px twitter. It opens a non valid url , in my case:
Code:http://twitter.com/home?status=Los+emprendedores+cambiar%C3%A1n+el+mundo%20-%20{
I haven’t changed any code, so, where can I modify it?
March 7, 2012 at 8:58 am #5713Aakash ChakravarthyKeymasterThe reason is, the link contains the “{” character. Twitter blocks links containing that character.
Try changing the Page URL. Its not a fault with WP Socializer.
March 9, 2012 at 2:33 pm #5712AnonymousGuestI have the same issue and have been digging into the problem. The issue happens when I add my bit.ly username and api-key in the WP Socializer settings. Without it, it works well but it sends the full page url to twitter instead of shortened url. I also tested it out be removing the {s-url} variable in wp-socializer/wp-socializer.php into {url} variable. It seems that something goes wrong with getting the shortened url from bit.ly. In my bit.ly account, I see all the shortened urls that have been requested, but somehow they don’t get back correctly in the {s-url} variable.
I hope you have a solution for this.
March 13, 2012 at 4:03 pm #5717Aakash ChakravarthyKeymasterThe best idea is to avoid characters like {, } etc in links. Not only twitter, even many other websites avoid that.
March 13, 2012 at 4:16 pm #5716AnonymousGuestBut those characters are not in the link at all !
I have a simple link like http://www.markvansetten.nl?p=205 or http://www.markvansetten.nl/en/2012/03/08/end-to-loneliness-demo/
When entering my bit.ly username and API key in the settings of your plugin, than something goes wrong, presumably with the short url returned from bit.ly (which according to your script should be in the {s-url} variable. It seems that there is something wrong with this variable and the script uses the { from that variable, instead of the value in that variable.
March 14, 2012 at 12:39 pm #5714Aakash ChakravarthyKeymasterStrange… I checked the code, it works fine. Did you find the bug there ??
March 14, 2012 at 12:59 pm #5715AnonymousGuestIf I replace the {s-url} variable with the {url} variable it all works fine (except that it is not using the bit.ly shortened URL). This indicates to me that something is going wrong with the {s-url} variable. What I don’t know as I haven’t been able to locate the code where you call the bit.ly to retrieve the shortened URL and where you set the {s-url} variable. I was hoping you could find the bug there.
March 18, 2012 at 5:28 pm #5709AnonymousGuestmsetten and vaakash, thanks to both of you.
As msetten said, replacing {s-url} with {url} solved the problem.
Thanks again!
March 18, 2012 at 6:35 pm #5710AnonymousGuestpeppelin wrote:msetten and vaakash, thanks to both of you.
As msetten said, replacing {s-url} with {url} solved the problem.
Thanks again!
It doesn’t actually solve the issue, it is just a workaround. With {url} the shortened bit.ly link are not used in the Twitter message but the full length link. This can make a message too long.
April 11, 2012 at 6:12 pm #5719AnonymousGuestCan you tell me where in your code is bit.ly being called and the {s-url} variable set? I have tried to find this myself, but can’t find it. I guess there is an error in there somewhere.
May 3, 2012 at 2:50 pm #5718Aakash ChakravarthyKeymastermsetten wrote:Can you tell me where in your code is bit.ly being called and the {s-url} variable set? I have tried to find this myself, but can’t find it. I guess there is an error in there somewhere.
Sorry for the late reply. You will find it in the “
wp-socializer/wp-socializer.php” file.May 3, 2012 at 6:06 pm #5711AnonymousGuestActually, in that file the {s-url} variable is read. I found out that the function that calls bit.ly is actually in wp-socializer/includes/wpsr-socialbuttons.php
I found that if I change the line (in the function wpsr_get_shorturl($url) ):
Code:$url = ‘http://api.bit.ly/v3/shorten?login=’ . $username . ‘&apiKey=’ . $apikey . ‘&uri=’ . urlencode($url) . ‘&format=’ . $format;
intoCode:$url = ‘http://api.bit.ly/v3/shorten?login=’ . $username . ‘&apiKey=’ . $apikey . ‘&format=txt&uri=’ . urlencode($url);
the shortened URL from bit.ly is successfully used with the 16px twitter button. It seems that there was a problem in the format setting.Now I hope that I can find out how to let the Twitter button (with the count) also use the shortened url from bit.ly. It now always uses the full url.
-
AuthorPosts
- The topic ‘Social 16px twitter not working’ is closed to new replies.