| View previous topic :: View next topic |
| Author |
Message |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Sep 25, 2010 3:52 pm Post subject: |
|
|
| Toruk wrote: | Hi speechles
I have installed the new version on my eggdrop and it works fine. Timestamp is spot on.
I then installed it exactly the same (except the tokens) on a friends eggdrop and we are still getting the:
"unable to convert date-time string "2010-09-25 19:14:46 +0100"
Now i looked into it a bit more and thought, well it cant be anything wrong on the script as its working on mine.
The one thing i found is that the time on my server is one hour behind my local time, whereas my friends server is our local time, one hour difference. Maybe why it is saying +0100" on hers? |
| Code: | <speechles> .tcl set a [clock scan "2010-09-25 19:14:46 +0100"]
<sp33chy> Tcl error: unable to convert date-time string "2010-09-25 19:14:46 +0100"
<speechles> .tcl set a [clock scan "2010-09-25 19:14:46 CET"]
<sp33chy> Tcl: 1285438486 |
Find this in that bots eggdrop.conf:
set timezone "+0100"
Change that to:
set timezone "CET"
If it was already that, then something weird is happening when obtaining timezones on that bot. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Toruk Voice
Joined: 27 Apr 2010 Posts: 8
|
Posted: Sat Sep 25, 2010 4:39 pm Post subject: |
|
|
| Code: | <speechles> .tcl set a [clock scan "2010-09-25 19:14:46 +0100"]
<sp33chy> Tcl error: unable to convert date-time string "2010-09-25 19:14:46 +0100"
<speechles> .tcl set a [clock scan "2010-09-25 19:14:46 CET"]
<sp33chy> Tcl: 1285438486 |
Find this in that bots eggdrop.conf:
set timezone "+0100"
Change that to:
set timezone "CET"
If it was already that, then something weird is happening when obtaining timezones on that bot.[/quote]
Ok, i looked but did not have "set timezone "+0100". I had "set timezone "GMT". Changed that to CET, but still the same after rehash and restart.
I even tried copying over my eggdrop.conf and running it on their server, but still the same  |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Sep 25, 2010 4:41 pm Post subject: |
|
|
| Toruk wrote: | even tried copying over my eggdrop.conf and running it on their server, but still the same  |
As a quick hack to get it working on that weird bot, we can do this:
| Code: | | lappend oauth_raw [list oauth_timestamp [clock scan [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S %Z"] -gmt 1]] |
Find that in "oauth.tcl" and change it to:
| Code: | | lappend oauth_raw [list oauth_timestamp [clock scan "[clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S"] CET" -gmt 1]] |
This will hard-code CET (GMT +1) onto it's timestamps during oauth transactions. This is a dirty way of fixing it. But sometimes it's good enough.  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Toruk Voice
Joined: 27 Apr 2010 Posts: 8
|
Posted: Sat Sep 25, 2010 4:59 pm Post subject: |
|
|
That's sorted it, thanks for your help speechles  |
|
| Back to top |
|
 |
kxng Voice
Joined: 27 Jun 2010 Posts: 6
|
Posted: Sun Sep 26, 2010 6:19 pm Post subject: |
|
|
Hello,
Sorry speechles for the delay
Like Toruk, the line you gave me doesn't work, but i take the last update of your tcl script, i don't have this error thanks for the fix !
I've got this error now,
| Quote: |
<heh> !friends
<TwitterBot> [Twitter]: OAuth failed: (401) Request: /1/statuses/friends.json; Error: invalid / used nonce
<heh> !tweet bla
<TwitterBot> [Twitter]: OAuth failed: (401) Request: /1/statuses/update.json; Error: invalid / used nonce
|
It's no the same error than trixar_za, but I tried to put the http.tcl in the eggdrop script folder, and put it in eggdrop.conf, it's doesn't work. tested with http1.0 & http2.5
btw in the older script and the new one, i've got this error in pl :
| Quote: | | Tcl error [proc:twitter:megahal:privatereply]: invalid command name "pulog" |
I replaced pulog to putlog at line 1017 for fix it |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Sep 26, 2010 7:11 pm Post subject: |
|
|
| kxng wrote: | Hello,
Sorry speechles for the delay
Like Toruk, the line you gave me doesn't work, but i take the last update of your tcl script, i don't have this error thanks for the fix !
I've got this error now,
| Quote: |
<heh> !friends
<TwitterBot> [Twitter]: OAuth failed: (401) Request: /1/statuses/friends.json; Error: invalid / used nonce
<heh> !tweet bla
<TwitterBot> [Twitter]: OAuth failed: (401) Request: /1/statuses/update.json; Error: invalid / used nonce
|
It's no the same error than trixar_za, but I tried to put the http.tcl in the eggdrop script folder, and put it in eggdrop.conf, it's doesn't work. tested with http1.0 & http2.5 |
Open oauth.tcl and make sure line 54 looks exactly as it is below: | Code: | | lappend oauth_raw [list oauth_timestamp [clock scan [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S %Z"] -gmt 1]] |
If it does look like this. Then you're timezone doesn't match the timezone the bot really is. In eggdrop.conf find: set timezone and change yours to the actual timezone the bot is using.
| kxng wrote: | btw in the older script and the new one, i've got this error in pl :
| Quote: | | Tcl error [proc:twitter:megahal:privatereply]: invalid command name "pulog" |
I replaced pulog to putlog at line 1017 for fix it |
Thanks for the heads up. This has been corrected.  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
kxng Voice
Joined: 27 Jun 2010 Posts: 6
|
Posted: Sun Sep 26, 2010 8:01 pm Post subject: |
|
|
Thank you speechles !
the tcl script works perfect now  |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
|
| Back to top |
|
 |
kxng Voice
Joined: 27 Jun 2010 Posts: 6
|
Posted: Mon Sep 27, 2010 12:54 am Post subject: |
|
|
Thanks for the explanation
I want to have the RT from friends-timelines, are there an option i've missed ? I searched a little but i'm not good at tcl :/
Not the RT when you say RT @user, but the RT when you click on "retweet"
I translated your script to french, just for the putlog for now, if you're interested I can make a complete translation and pm the translated script  |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Sep 28, 2010 4:35 pm Post subject: |
|
|
| kxng wrote: | Thanks for the explanation
I want to have the RT from friends-timelines, are there an option i've missed ? I searched a little but i'm not good at tcl :/
Not the RT when you say RT @user, but the RT when you click on "retweet" |
This is easily accomplished. The script just doesn't natively do that because it's usually quite spammy. But if you want it you can easily add it yourself. Let me show you how:
Within "proc:twitter:restapi" procedure, find:
| Code: | if {[string match "otheruser*" $type]} {
if {![string length [string trim [set who [string map {" " "_"} [join [lrange [split $type] 1 end]]]]]]} { set who "$tuser" }
set other "?[http::formatQuery screen_name $who]"
set q [list [list "screen_name" "$who"]]
set type "user"
} elseif {![string match "search*" $type]} {
set other ""
set q ""
} else {
if {![string length [string trim [set who [join [lrange [split $type] 1 end]]]]]} { set who "$tuser" }
set other ""
set q [list [list q [oauth:uri_escape $who]]]
set type "search"
} |
Change it to look like this: | Code: | if {[string match "otheruser*" $type]} {
if {![string length [string trim [set who [string map {" " "_"} [join [lrange [split $type] 1 end]]]]]]} { set who "$tuser" }
set q [list [list "screen_name" "$who"] [list include_rts true]]
set type "user"
} elseif {![string match "search*" $type]} {
set q [list [list include_rts true]]
} else {
if {![string length [string trim [set who [join [lrange [split $type] 1 end]]]]]} { set who "$tuser" }
set q [list [list q [oauth:uri_escape $who]] [list include_rts true]]
set type "search"
} |
This will _FORCE_ retweets to show in all restapi/search results. The variable "other" isn't required either. I've just left it there, as I migrated the script from basic authentication to full oauth. This is the reason you see it missing from my code change above. q contains the query to issue through oauth. This is a list, of lists, each sub-list containing a single name/value pair. This is to keep any special characters from being handled incorrectly. You can add more "entities" into the uri this way. There are alot that I don't make use of
| kxng wrote: | I translated your script to french, just for the putlog for now, if you're interested I can make a complete translation and pm the translated script  |
You can release your translated version in this thread as well, so can others. Only a few of the messages can be user-edited, mainly because I prefer clean functionality over ease of configurability. Alot of the messages are "hard-coded" in English because of this. So of course for other users benefit, feel free to share these translated copies, by all means. Even in this thread
BTW, to developers. oauth.tcl will work for _any_ eggdrop/tcl twitter script if you make a small (1/2 line) modification in your script where you presently use basic auth and http::geturl to do it. If you need help getting your script to do similar to this. I can show you how using the "oauth.tcl" this script includes. This is why it is included seperately My twitter.tcl does not use "http::geturl", except when faking a web-browser and giving !twitter replies , other than that though everything is handled implicitly through oauth as the application and user matching it's credentials. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
kxng Voice
Joined: 27 Jun 2010 Posts: 6
|
Posted: Wed Oct 06, 2010 10:24 pm Post subject: |
|
|
Thanks speechles !
I'll try to do that  |
|
| Back to top |
|
 |
rhysm0e Voice
Joined: 02 Nov 2010 Posts: 1
|
Posted: Tue Nov 02, 2010 8:51 pm Post subject: |
|
|
Hey speechless, thank you for the great walk through. I am completely up and running with the exception of the time being off. I am GMT -5 hours, can you tell me how to add this properly? Further down in this thread you showed a "dirty fix" for the time issue. I copy and pasted like you suggest and tried to change the line for my timezone but was unsuccessful. I am EST GMT -5. Thanks in advance for your help.
I realized that may be a bit vague. By "time being off" i mean that it says a tweet was posted say 2 hours ago, but it just happened. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Nov 04, 2010 5:58 am Post subject: |
|
|
Here's a new version.. YAY!!
This corrects some small bugs, presents a cleaner display and gives one new option to both oAuth.tcl and twitter.tcl.
New to oAuth.tcl is: | Code: | # Use this to set your timezone on your bot. Most people
# should never need to change this. For FreeBSD you most
# likely will need to alter this.
set oauth_time "%Y-%m-%d %H:%M:%S %Z" |
This allows you to hard-code timezones or other things into your oAuth timestamp. The "hack" above is no longer required, as this is a cleaner approach of it.
New to twitter.tcl is: | Code: | # Use this to fix timestamp durations and correct
# issues synching your time to twitter's GMT time.
# Enter the seconds offset required below, to disable
# set this to 0. This is useful for Daylight savings
# time adjustments, as well as other issues.
# Use either a Positive, or -Negative offset.
# (integer)
set twitter(fixMyDuration) "3600" |
This is used to correct time offsets between your bot's time when converted to GMT vs twitter. This allows for daylight saving issues, Where europe is Oct31st yet America is Nov7th. For that week, I will need to keep FixMyDuration at 3600 to make up for this hour difference. You may have to do the same. This will also help adjust when your shell time, say is 40 or more seconds greater than twitter. You simply change the fixMyDuration above to 40. This can be set to positive or negative values depending upon the situation. If you need help explaining these, ask...
Here's a brief example of how it looks: | Quote: | <sp33chy> Joystiq: Kinect is now available! Read our extensive launch coverage, including reviews of the hardware and launch titles: http://aol.it/aNtFje ( 29638602568@joystiq - 25s ago via Tweetie for Mac )
<sp33chy> IGN: The Kinect reviews are in! Check out our complete Microsoft #Kinect coverage here. | http://go.ign.com/9fFp7p ( 29638659561@IGN - 30s ago via web )
<sp33chy> GameSpot.com: RUMOR: Kinect has problems recognizing dark-skinned users? http://gamespot.com/6283514 ( 29638688665@gamespot - 1s ago via HootSuite )
<sp33chy> Kotaku: Review: Kinect http://kotaku.com/5680501/ ( 29638728475@Kotaku - 22s ago via kotaku ) |
Get the new script: OAuth, Twitter, Tweets & MegaHAL v5.01 _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
s1lenz Voice
Joined: 04 Nov 2010 Posts: 1
|
Posted: Thu Nov 04, 2010 11:42 pm Post subject: |
|
|
| I'm getting the message 20:39] Tcl error [proc:twitter:megahal:privatereply]: can't use empty string as operand of "-" even though I have megahal off. Any ideas? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Nov 05, 2010 2:52 am Post subject: |
|
|
| s1lenz wrote: | | I'm getting the message 20:39] Tcl error [proc:twitter:megahal:privatereply]: can't use empty string as operand of "-" even though I have megahal off. Any ideas? |
| Code: | # Use this to fix timestamp durations and correct
# issues synching your time to twitter's GMT time.
# Enter the seconds offset required below, to disable
# set this to 0. This is useful for Daylight savings
# time adjustments, as well as other issues.
# Use either a Positive, or -Negative offset.
# (integer)
set twitter(fixMyDuration) "0" |
Make sure this setting is 0, and not "". Then it should work as expected. If after you tweet, you notice time is off. Use this setting to adjust your durations to accuracy. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|