This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Birdy (OAuth, Twitter, Tweets&MegaHAL v6.01d) Jun12,2013

Support & discussion of released scripts, and announcements of new releases.
Post Reply
b
bfoos
Voice
Posts: 6
Joined: Thu Sep 30, 2010 6:17 pm

Post by bfoos »

Hey, speechles... Tried to query you on IRC about this. I'm getting the following error using this script...

Code: Select all

[15:27:00] Tcl error [proc:twitter:megahal:privatereply]: invalid command name "getreply"
[15:27:01] (Megahal) eggfoos replied to (tehcollective) accounts.
Using MegaHAL v3.5
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

<speechles> !tweet @emily_d_k HI :)\n░╔══╗░░░░╔╦╗░░░╔═════╗░☺\n░║╚═╬════╬╣╠═╗░║░▀░▀░║░\n░╠═╗║╔╗╔╗║║║╩╣░║╚═══╝║░\n░╚══╩╝╚╝╚╩╩╩═╝░╚═════╝░
<sp33chy> Tweet created: http://twitter.com/suqmuhnutz ( 24289599496912896@suqmuhnutz - 0s ago via bittersweet )

<speechles> !user 1-1
<sp33chy> ( 1-1 ) User timelines ( #roms-isos@suqmuhnutz ) http://twitter.com/suqmuhnutz :
<sp33chy> #roms-isos@efnet: @emily_d_k <speechles> HI :) ( 24289599496912896@suqmuhnutz - 6m, 3s ago via bittersweet )
<sp33chy> #roms-isos@efnet: ░╔══╗░░░░╔╦╗░░░╔═════╗░☺
<sp33chy> #roms-isos@efnet: ░║╚═╬════╬╣╠═╗░║░▀░▀░║░
<sp33chy> #roms-isos@efnet: ░╠═╗║╔╗╔╗║║║╩╣░║╚═══╝║░
<sp33chy> #roms-isos@efnet: ░╚══╩╝╚╝╚╩╩╩═╝░╚═════╝░

<speechles> !tsearch #140art 3-3
<sp33chy> ( 3-3 ) Search timelines ( #roms-isos@suqmuhnutz ):
<sp33chy> angelahnicole: RT @TW1TT3Rart: #TWITTERART RT @140ARTIST ( 24262516209094656@angelahnicole - 1h, 16m, 20s ago via web )
<sp33chy> angelahnicole: ─▒▒▒▒▒▌──▓▓▓▓▓▌──░░░░░▌
<sp33chy> angelahnicole: ▒▌▄▒▌▄▒▌▓▌▄▓▌▄▓▌░▌▄░▌▄▒▌
<sp33chy> angelahnicole: ▒▒▒▒▒▒▒▌▓▓▓▓▓▓▓▌░░░░░░░▌
<sp33chy> angelahnicole: ▒▌▒▌▒▌▒▌▓▌▓▌▓▌▓▌░▌░▌░▌░▌ ⋕Եժ #140art

<speechles> !tweet \n█▄▐▌▐▌──▐▀▄─▐▌───▐▌█▀─█▄▐▌█─▀▐█▀▀\n█──██▐▀▄─▐█─▐▌─█▐▐█▌──█─▐██▐▌─▀▀▄⋕Եժ\n██─▐▌▐▄▀▐▄▀─▐█▌▐▐▐▌█▄─██▐▌█▐▌▀██▀\n─────▐▌───────▄▄▀
<sp33chy> Tweet created: http://twitter.com/suqmuhnutz ( 24165464024285184@suqmuhnutz - 0s ago via bittersweet )

<speechles> !user 1-1
<sp33chy> ( 1-1 ) User timelines ( #roms-isos@suqmuhnutz ) http://twitter.com/suqmuhnutz :
<sp33chy> #roms-isos@efnet: <speechles> ( 24165464024285184@suqmuhnutz - 48m, 34s ago via bittersweet )
<sp33chy> #roms-isos@efnet: █▄▐▌▐▌──▐▀▄─▐▌───▐▌█▀─█▄▐▌█─▀▐█▀▀
<sp33chy> #roms-isos@efnet: █──██▐▀▄─▐█─▐▌─█▐▐█▌──█─▐██▐▌─▀▀▄⋕Եժ
<sp33chy> #roms-isos@efnet: ██─▐▌▐▄▀▐▄▀─▐█▌▐▐▐▌█▄─██▐▌█▐▌▀██▀
<sp33chy> #roms-isos@efnet: ─────▐▌───────▄▄▀
Full ascii-art support now included. You can create these, as well as easily view them from the comfort of IRC. Two options below control this feature:

Code: Select all

# Split tweets with newlines into multi-line tweets?
# Without this set to 1, ascii art tweets will not
# show correctly.
# (0 no/1 yes)
set twitter(newline) 1

# Allow newlines in tweets? With this, you can create
# multi-line tweets on IRC by using \n to seperate
# each line.
# (0 no/1 yes)
set twitter(allow_newlines) 1
Also included, is !apps +app and -app commands. These allow you to ignore specific applications from automatically relaying to your channel. This helps if people attach iPhone applications to their twitter accounts and these applications keep tweeting achievement updates. To block these iPhone app updates, yet keep the rest of what that @username has to say automatically relaying. +app that_iPhone_app it's that easy.

Get the new version here:Twitter, Tweets with Megahal v5.02 (Egghelp version)
Enjoy and have a fun. ;)

If you experience any issues, please post about them in this thread.

NOTE: If your eggdrop is properly utf-8 patched and you are experiencing issues with proper encoding output.

Code: Select all

if {![string equal $char [encoding system]]} { set text [encoding convertto $char $text] }
Find the above line, and comment it out. This will solve that issue.
____
bfoos wrote:Hey, speechles... Tried to query you on IRC about this. I'm getting the following error using this script...
The problem is megahal version 3.5 does not give scripts any ability to interact with it. Making it unfortunate, but you cannot get interactiveness with this script using that version of megahal. Sorry :(
b
bfoos
Voice
Posts: 6
Joined: Thu Sep 30, 2010 6:17 pm

Post by bfoos »

speechles wrote:
bfoos wrote:Hey, speechles... Tried to query you on IRC about this. I'm getting the following error using this script...
The problem is megahal version 3.5 does not give scripts any ability to interact with it. Making it unfortunate, but you cannot get interactiveness with this script using that version of megahal. Sorry :(
Yup, gleaned that from your rather lengthy explanation on IRC. :D

Will likely switch over to BarkerJr's version at some point.

At any rate, stellar work on this script. I'm loving the ACII art.
S
SignZ
Voice
Posts: 18
Joined: Thu Jun 17, 2010 3:52 pm

Post by SignZ »

Yo speechles. I think I just found another flaw.
If a twitter-user got/posts/tweets location information in a tweet, your script fetches the location as $name instead of the name.
K
Karunamon
Voice
Posts: 5
Joined: Sun Aug 01, 2010 1:55 pm

Post by Karunamon »

I'm having a slightly annoying issue with twitter's region detection. The physical server and internet connection that my bot is running on is in Canada, but for some reason a couple of weeks ago, I started getting french responses to the requests instead of english ones.

Code: Select all

[3:02pm] <+Misato> [Twitter]: Nom: Misato Katsuragi; Localisation: The Internets; Following: 3; Followers: 5; Listed: 0; Total Tweets: 39.
[3:02pm] <+Misato> [Twitter]: I am an eggdrop bot for Lost Signal Networks #main IRC channel. Various people may show up in my stream. Follow for randomness. Owner/Operator: @tkware
[3:02pm] <+Misato> [Twitter]: Last Tweet: [33646312754778112] (Il y a moins de 10 secondes via Misato the Eggdrop Bot): <Odin> Marisa had to go to the bathroom
[3:02pm] <+Misato> [Twitter]: http://twitter.com/lsnmain [Region: fr]
I think I understand what's happening, but I'm not proficient enough at TCL to know how to fix it. Any ideas how I force it to stay in region: en-us?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Karunamon wrote:I'm having a slightly annoying issue with twitter's region detection. The physical server and internet connection that my bot is running on is in Canada, but for some reason a couple of weeks ago, I started getting french responses to the requests instead of english ones.

Code: Select all

[3:02pm] <+Misato> [Twitter]: Nom: Misato Katsuragi; Localisation: The Internets; Following: 3; Followers: 5; Listed: 0; Total Tweets: 39.
[3:02pm] <+Misato> [Twitter]: I am an eggdrop bot for Lost Signal Networks #main IRC channel. Various people may show up in my stream. Follow for randomness. Owner/Operator: @tkware
[3:02pm] <+Misato> [Twitter]: Last Tweet: [33646312754778112] (Il y a moins de 10 secondes via Misato the Eggdrop Bot): <Odin> Marisa had to go to the bathroom
[3:02pm] <+Misato> [Twitter]: http://twitter.com/lsnmain [Region: fr]
I think I understand what's happening, but I'm not proficient enough at TCL to know how to fix it. Any ideas how I force it to stay in region: en-us?
This is mostly because of heritage. This scripts humble beginnings as strictly a "one trick pony"[1].

All it did was !twitter <username> .. that's it ..

This fakes a web browser, approaches without cookies, and just pulls the user page up on twitter. It then uses it's parsers to cut away their templates and get to the data. It uses their templates to name fields. This causes the issue you see. Some of twitters templates are regionalized. There is no present way to really fix this. Your IP is french canadian. It gives you french as a courtesy.

Over time of course, this has curved into using the API under oauth allowing more features to evolve. The one part still stuck in the past is any !twitter request. I apologize.. :/

I will eventually fix the issue signz reported regarding geo-coded tweets and incorrect name field used as account name. I will also re-write the !twitter function to properly use oauth and use the API. This will rectify the issue you are having presently.

* [1] One trick pony: In software development, a very limited program can be a serious liability, for example, since while it may attract attention at first, users will abandon it if it does not develop into a more rounded whole.
J
Jagg
Halfop
Posts: 53
Joined: Sat Jan 24, 2004 11:32 am

Post by Jagg »

Can I use this tcl to only show/present the tweets from some twitter user I want?

I don't want to make tweets from an irc channel or sth like that... I only want to set 3-10 twitter usernames the bot should "check for new tweets". If a new tweet was made from this 2-10 twitter names the bot should post that in the channel.

Thanks
K
Karunamon
Voice
Posts: 5
Joined: Sun Aug 01, 2010 1:55 pm

Post by Karunamon »

Since you basically have to register a twitter account and API access for your bot, all you need to do is only !follow users you want the bot to get tweets from.

speechles: I've also had a problem develop with that over the past three days.. !tweets are not being confirmed in the channel when they're posted (they still make it though okay) and followers stopped working also.

Sounds a lot like twitter's been mucking with the API again.

Thanks very much :D
J
Jagg
Halfop
Posts: 53
Joined: Sat Jan 24, 2004 11:32 am

Post by Jagg »

I always get this error
!user
<bott> OAuth failed: (401) Request: \/1\/statuses\/user_timeline.json?include_rts=1&screen_name=irc_tradingbot; Error: timestamp out of bounds

Code: Select all

eggdrop.conf: set timezone "CET" 
twitter.tcl: set twitter(fixMyDuration) "0" (also tried 3600/7200)
My timezone is GMT+1 (Berlin)

UPDATE: Got it... the bot server time was wrong!
J
Jagg
Halfop
Posts: 53
Joined: Sat Jan 24, 2004 11:32 am

Post by Jagg »

I get such error logs in partyline

Code: Select all

[13:49:30] Tcl error [proc:twitter:user2]: Unknown option -urlencoding, must be: -accept, -proxyfilter, -proxyhost, -proxyport, -useragent
[13:51:00] Tcl error [proc:twitter:friendsauto]: Unknown option -urlencoding, must be: -accept, -proxyfilter, -proxyhost, -proxyport, -useragent
My versions:
Twitter, Tweets with Megahal v5.03 (<- is this the latest version? or is still 5.02 the bugfree version?)
eggdrop v1.6.20 (utf-8 patched)

UPDATE:
Hmmm, ok commented that out as written in that post.

The last problem I have now is !user don't work anymore:

Code: Select all

[15:00:46] Tcl error [proc:twitter:user2]: invalid command name "\},\{ {
}"
...and also on every check i get

Code: Select all

[15:01:00]  can't read "status": no such variable
[15:01:01]  can't read "status": no such variable
lines in partyline
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

5.03 is the pre-release beta version I needed people to test. Thank you for testing it. Yes, it had some minor issues that were worked out. Most of those you are experiencing..

I've since corrected all these issues, better OAuth error protection, and better all around at moving faster. I've lowered the timeouts from 10seconds to 5seconds. I've also beefed up the OAuth error mechanisms. The problem is when twitter has constant fail whales, the script would'nt realize the site had timed out. It would attempt to get http::data and this would freeze the bot for 3-5 minutes until it timed out. This was a huge flaw, and is now corrected. So yes, 5.02 is buggy. The pre-release 5.03 was buggy. The final 5.03 version which you see at the url below should be 100% bug-free.

Click below to get the newest version:
OAuth, Twitter, Tweets with Megahal v5.03

...and as always, have a fun, and dance like an robot ;D
J
Jagg
Halfop
Posts: 53
Joined: Sat Jan 24, 2004 11:32 am

Post by Jagg »

from eggtcl chat:
[17:25] speechles: i think you forgot a } after line 1401 in your new twitter.tcl version 5.03
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Jagg wrote:from eggtcl chat:
[17:25] speechles: i think you forgot a } after line 1401 in your new twitter.tcl version 5.03
That would crash your bot if that were so. So yeah, whatever. There is no missing }... Works fine for me... speechles out...
J
Jagg
Halfop
Posts: 53
Joined: Sat Jan 24, 2004 11:32 am

Post by Jagg »

It crashed my bot :wink: (until I set that "}"... don't know if i edited something wrong before... but i don't think so)
F
Farbmeister
Voice
Posts: 1
Joined: Fri Mar 18, 2011 8:36 am

Post by Farbmeister »

I have this error ?!?!

Code: Select all

Eggdrop: [19:21] Tcl error [proc:twitter:friendsauto]: no such channel record
Eggdrop: [19:21] Tcl error [proc:twitter:megahal:privatereply]: no such channel record
Eggdrop: [19:21] Tcl error [proc:twitter:megahal]: no such channel record
Have I forgotten anything?
What can i do ?
Gruss
Farbmeister

(german User)
Post Reply