Page 1 of 2
"Check tweetbacks" URLs problem in event_twitter
Posted: Sun Apr 03, 2011 3:07 pm
by LazyBadger
Move topic in "Plugins" section, if I misplaced message
Try event_twitter now, found strange URLS in "Check tweetbacks" page
1. Announced entry URL -
http://mayorat.e-city.net.ru/blog/archi ... itter.html
2. URLs on Tweetbacks Statistic page are
- RT:0 ID:5.4510599119454E+16, i.e
http://twitter.com/ecity_mayorat/status ... 119454E+16 (404 error)
- comment url in blog
http://twitter.com/ecity_mayorat/status ... 119454E+16 (404 error too)
3. Twitter
real URL of announce is
http://twitter.com/ecity_mayorat/status ... 9119454209
Not a big problem for me, maybe smth. personal, but I have to note it
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Sun Apr 03, 2011 6:16 pm
by garvinhicking
Hi!
Which version of the twitter plugin do you have? This should've been a bug in earlier versions.
Please check your serendipity_tweetbackhistory's field "lasttweetid". It should be varchar(20). Also serendipity_tweets should have a id column as bigint...?!
Regards,
Garvin
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Sun Apr 03, 2011 6:38 pm
by LazyBadger
garvinhicking wrote:
Which version of the twitter plugin do you have?
Fresh, installed today from Spartacus - 1.32,as shown in admin-side
garvinhicking wrote:Please check your serendipity_tweetbackhistory's field "lasttweetid". It should be varchar(20). Also serendipity_tweets should have a id column as bigint...?!
TABLE `serendipity_tweetbackhistory` (
`entryid` int(10) NOT NULL,
`lasttweetid` varchar(20) NOT NULL,
`lastcheck` int(10) NOT NULL,
/* Keys */
PRIMARY KEY (`entryid`)
) ENGINE = InnoDB;
No table tweets, only tweetbackhistory + tweetbackshorturls
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Sun Apr 03, 2011 10:49 pm
by garvinhicking
Hi!
If you browse those tables, do the tweet-ids seem truncated somehow, or are they proper without this "E0x" addition? The error seems to be caused because a number is longer than the avaiblale storage space, so it's converted to a shorter number. Maybe already varchar(20) is too little and we need to raise it again?!
(Remember though that changing to varchar(50) for example will not fix existing entries, only new ones put there...)
I'd be happy if we can find out what's happening...
Regards,
Garvin
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Mon Apr 04, 2011 7:04 am
by LazyBadger
Export from serendipity_tweetbackhistory seems OK
Code: Select all
entryid lasttweetid lastcheck
8 0 1301 830 075
9 0 1301 842 209
tweetbackshorturls doesn't have tweetids at all
Maybe missing serendipity_tweets IS source of problem? I can create this table by hand, I saw CREATE TABLE definition in *_plugin code
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Mon Apr 04, 2011 10:37 am
by garvinhicking
Hi!
Hm, serendipity_tweets actually is created when you have the "backup tweets" option enabled.
It seems then some other PHP or javascript code is improperly treating the Twitter-IDs. Do you use Javascript or PHP for the twitter output (see your plugin configuration)? Then I'll try to inspect that properly.
Regards,
Garvin
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Mon Apr 04, 2011 10:52 am
by LazyBadger
OK, I haven't backup enabled.
I tried both versions, with the same result (JS was used on creating fist announce). Can select any on your choice and test.
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Mon Apr 04, 2011 1:18 pm
by garvinhicking
Hi!
Hm, where exactly do you see the faulty entries? In the language file I can see no "Check Tweebtacks" that could be used as a title anywhere, so I don't know yet where exactl you reference to.
I was thinking you meant the sidebar plugins, but reading through your original post I believe this might not be the place you're talking about.
Regards,
Garvin
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Mon Apr 04, 2011 1:45 pm
by LazyBadger
Hm, where exactly do you see the faulty entries?
On
separate entry page (not in entry-list) above "Tweet this button"
only when I logged-in into backend I see link with text "check tweetbacks"...
In the language file I can see no "Check Tweebtacks" that could be used as a title anywhere
This string hardcoded in PHP-code, serendipity_event_twitter.php - string 1591
Code: Select all
$tweetback_check_msg = '<div class="serendipity_tweetback_check"><a target="_blank" href="' . $checkurl . '">check tweetbacks</a></div>';
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Mon Apr 04, 2011 2:01 pm
by garvinhicking
Hi!
Ah, great! I wasn't properly aware of that URL output. I just patched the plugin so that the ID should now get properly converted. Many thanks for your help in this!
Regards,
Garvin
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Tue Apr 05, 2011 9:32 am
by LazyBadger
I see changes in the right direction, but sorry, Garvin, one more additional fix is needed
For some article (is this URL needed really?) "Check tweetbacks" page produces now (as example)
54877101727301632, but
54877101727301633 is correct URL
In "more words" form: all twitter URLs ID must be +1 to current value (v1.33)
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Tue Apr 05, 2011 9:40 am
by garvinhicking
Hi!
Hhhm...I believe that the sprintf('%0.0f') syntax for converting the proper number to a string is doing some rounding. If we add +1 this means some other entries would mismatch.
I don't know how to convert the number properly to a string...
Regards,
Garvin
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Tue Apr 05, 2011 9:59 am
by Timbalu
How about specifying the length?
Just guessing width specifier like sprintf('%17.0f') ?
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Tue Apr 05, 2011 11:09 am
by LazyBadger
If
Code: Select all
$ids = '5451059911945420';
echo sprintf("%0.0f\n", $id);
echo sprintf("%17.0f", $id);
then results are the same
Re: "Check tweetbacks" URLs problem in event_twitter
Posted: Tue Apr 05, 2011 11:18 am
by Timbalu
and why not use simple %s as string representation?
echo sprintf("%s", $id);
or
sprintf('%s', (string)$item->tweet_id);