| 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 11, 2010 9:43 am Post subject: |
|
|
| Huko wrote: | hey speechless, I have only one question, I didn't see any reference about using rss-synd to relay tweets from the account to IRC.
set rss(football) {
"url" "https://username:password@twitter.com/statuses/friends_timeline.rss"
Does this need configuration? |
Well, for one thing... The multi-function twitter script I wrote (which one of those functions is mimic rss feeds) isn't related at all to rss-synd. Rss-synd can no longer read protected resources on twitter (friends,mentions,home). All it can do is read your public profile with basic-auth.
What you do for the moment is use rss-synd in _combination_ with this twitter script. Rss-synd doesn't let you !tweet back to the twitter feed. The twitter script does.
With twitter you have these automated functions:
Display friends timelines just like rss
Display mention timelines just like rss
Automate MegaHAL replies into the profile
Automate MegaHAL replies at mention timelines
You also have these functions users can do:
!tweet text here
!user username x-y - see a user profile page; username is optional; x-y is optional range
!myfriends x-y - your friends; x-y is optional range
!mymentions x-y your mentions; x-y is optional range
!myprofile x-y your profile; x-y is optional range
!myhome x-y your home; x-y is optional range
+follow - add a feed
-follow - remove a feed
!friends - list feeds
!followers - list those reading your feed
+service - add a username or list of usernames to the bot's MegaHAL ignore list
-service - remove a username or list of username from bot's MegaHAL ignore list
!services - list bot's MegaHAL ignore list
I will create an oauth package that can be used within rss-synd like a plug-on of sorts soon. This will give rss-synd the ability to use OAuth single use tokens and the ability to read twitters protected resources rss feeds. But at this point, to have both. You need to use both rss-synd and this twitter script.  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Huko Voice
Joined: 08 Jun 2010 Posts: 18
|
Posted: Thu Sep 16, 2010 5:56 am Post subject: |
|
|
I didn't quite understand you speechless, I`ve made an application through that link and added the consumer_key and consumer_secret tokens, access_token_key and access_token_secret.
I added it to the login account section on twitter.tcl
What do I need to do next to make your twitter.tcl script work as a rss read for tweets? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Sep 16, 2010 6:16 am Post subject: |
|
|
| Huko wrote: | I didn't quite understand you speechless, I`ve made an application through that link and added the consumer_key and consumer_secret tokens, access_token_key and access_token_secret.
I added it to the login account section on twitter.tcl
What do I need to do next to make your twitter.tcl script work as a rss read for tweets? |
Add your accounts to the twitter(accts) section within twitter.tcl. Then...
Source the 4 TCL's within twitter.zip in the CORRECT order.
If you don't have sha1 or base64 packages follow steps 1 and 2.
Otherwise skip them and start at step 3.
1) sha1.tcl
2) base64.tcl
3) oauth.tcl
4) twitter.tcl
# REMEMBER TO MAKE THIS WORK IN YOUR CHANNEL:
# Type in partyline: ".chanset #yourchannel +twitter"
# FOR MEGAHAL TO REPLY TO USERS WITHIN YOUR CHANNELS ACCOUNT:
# Type in partyline: ".chanset #yourchannel +twittermega"
# FOR @MENTIONS TO WORK:
# Type in partyline: ".chanset #yourchannel +twittermentions
# FOE MEGAHAL TO REPLY TO @MENTIONS:
# Type in partyline: ".chanset #yourchannel +twittermentionsmega"
# FOR FRIENDS TIMELIMES TO WORK:
# Type in partyline: ".chanset #yourchannel +twitterfriends"
Follow the config. If you don't have megahal on your bot, don't enable that feature. You want +twitterfriends and perhaps +twittermentions enabled. Then customize the output line to what you like. It's that easy. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Thu Sep 16, 2010 8:17 pm Post subject: |
|
|
I'm getting:
[02:03:38] [&Trixar_za] !tweet Now I REALLY broke it good
[02:03:40] [GameBot] [Tweet]: OAuth failed: (401) Request: /1/statuses/update.json; Error: incorrect signature
Yes, I checked the order the scripts are loaded in: sha1, base64, oauth and twitter. Yes, I tried with sha1 and bash64 commented out - same error. Yes, I triple checked and made sure the customer_key, customer_secret, access_tokern_key and access_tokern_secret was right
So what might be the problem? _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Sep 16, 2010 10:49 pm Post subject: |
|
|
hmm.. that is odd indeed...
Retry with this copy of the script. It corrects tiny mistakes here and there, maybe this solves it. Also, on your application page on twitter. Did you ask for BOTH read and write permissions? To tweet you need to do this.
| Quote: | <speechles> !tweet Now I REALLY broke it good
<sp33chy> [Twitter]: Tweet created: 0s ago via sp33chy teh eggdrop at #roms-isos@efnet (24722093999@suqmuhnutz) #roms-isos @ http://twitter.com/suqmuhnutz
<speechles> !tweet \[{'hi'\]} testing special characters %&Q#@$&^^&!~'\/|+=-_**~``` etc etc
<sp33chy> [Twitter]: Tweet created: 0s ago via sp33chy teh eggdrop at #roms-isos@efnet (24723964488@suqmuhnutz) #roms-isos @ http://twitter.com/suqmuhnutz
<speechles> +follow suqmuhnutz
<sp33chy>[Twitter]: OAuth failed: (403) Request: /1/friendships/create.json; Error: could not follow user: you can't follow yourself!
<speechles> +follow secondpower
<sp33chy> [Twitter]: OAuth failed: (403) Request: /1/friendships/create.json; Error: could not follow user: you have been blocked from following this account at the request of the user.
<speechles> +follow badusernamensuch
<sp33chy> [Twitter]: OAuth failed: (404) Request: /1/friendships/create.json; Error: not found |
This is _exactly_ how it works for me. The only time I see "oauth failed" messages is when twitter itself is giving me an error, user not found, can't follow yourself, etc..
If you still have problems after this let me know  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Sep 17, 2010 8:48 am Post subject: |
|
|
Same issue as before. I deleted and created a new app - this time as a web service rather than a client. Both times was set to read/write and I changed all the file permissions (including twitter.dat) to 777. Maybe it's the host or something just not working for me? _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Sep 17, 2010 1:03 pm Post subject: |
|
|
| Trixar_za wrote: | | Same issue as before. I deleted and created a new app - this time as a web service rather than a client. Both times was set to read/write and I changed all the file permissions (including twitter.dat) to 777. Maybe it's the host or something just not working for me? |
Let me explain a little more just to clarify it all. | Quote: | 01) Go to http://twitter.com and login to your account
02) After your logged in, visit this url: http://dev.twitter.com/apps/new
03) Fill out the form. Choose CLIENT and READ/WRITE/DIRECT MESSAGE Access. The rest you can choose anything. Submit the form.
04) Copy your Consumer_key and Consumer_secret into a text editor.
05) Click the [my access token] button on the right.
06) Copy your Access Token (oauth_token) and your Access Token Secret (oauth_token_secret) into the same text editor
07) Extract the entire contents of twitter.zip into your scripts/ folder.
08) open twitter.tcl and find the twitter(accts) section
09) add your accts copying them from the text editor (this helps alleviate any typos) and make sure you follow the ordering set below.
"#chan|acct|consumer_key|consumer_secret|access_token_key|access_token_secret"
10) save twitter.tcl
11) open eggdrop.conf
12) edit eggdrop.conf adding the following scripts in the order below:
If you have tcl-lib installed omit sourcing sha1 and base64
source scripts/sha1.tcl
source scripts/base64.tcl
source scripts/oauth.tcl
source scripts/twitter.tcl
13) save eggdrop.conf
14) .rehash, .restart, or start your bot
15) log into partyline and issue the following commands.
.chanset #yourchan +twitter
.chanset #yourchan +twitterfriends
.chanset #yourchan +twittermentions
.chanset #yourchan +twittertrack
.chanset #yourchan +twitterfollowers
if you have megahal on your bot, you can also enable that
.chanset #yourchan +twittermega
.chanset #yourchan +twittermentionsmega
16) try to check your status, type !user in #yourchan
17) try to check your friends, type !friends in #yourchan
18) try to follow someone, type +follow username
19) try to track some search terms, type +track this that
20) try to tweet, type !tweet some stuff here |
If any of these steps fail for you, note which step and it will be easier to offer help knowing that you've followed how this needs to be setup.  _________________ speechles' eggdrop tcl archive
Last edited by speechles on Wed Jul 13, 2011 12:30 am; edited 4 times in total |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Sep 17, 2010 2:03 pm Post subject: |
|
|
Followed all the steps, but !tweet still isn't working. Funny enough everything else is:
| Quote: | [20:01:01] [&Trixar_za] !user
[20:01:06] [GameBot] [4-1] User timelines (#IRC-Wiki@ircwiki) @ http://twitter.com/ircwiki :
[20:01:06] [GameBot] (04/20) 13w, 1d, 16h, 47m, 26s ago via web (16350544524@IRCWiki) (IRC Wiki): IRC Wiki is currently undergoing some theme changes, and they are looking terrific! Watch this space! -=- http://irc-wiki.org
[20:01:07] [GameBot] (03/20) 11w, 5d, 19h, 39m, 9s ago via API (17121387159@IRCWiki) (IRC Wiki): Added Genshi Code Highlighting, Live Chat & reduced the nav menu. Round Corners work in all NEW browsers (but IE)! - http://www.irc-wiki.org
[20:01:08] [GameBot] (02/20) 9w, 3d, 22h, 54m, 57s ago via mobile web (18375492682@IRCWiki) (IRC Wiki): We're busy revamping thanks to MrJones and we're finally completely SEO'd! Great Changes ahead! http://www.irc-wiki.org
[20:01:10] [GameBot] (01/20) 17h, 20m, 10s ago via web (24712237563@IRCWiki) (IRC Wiki): We added a forum to The IRC Wiki. Have your say in our future developments & plans - So come and register already! - http://www.irc-wiki.org
[20:01:43] [&Trixar_za] !friends
[20:01:47] [GameBot] [Twitter]: [#IRC-Wiki@ircwiki] (following): NixtaServices, IRCResource, roomsapp, echelon4, ChatcabinIRC, JanusIRC, Badger09, UKMadZone, IHNIirc, OptixIRC, EFNet, InsaneIRC, vipa5000, miniCruzer911, EPL_Quakenet, RiftNET, Wikipedia, IRC_Tech, SporksIRC, FailBot_IRC_Bot
[20:01:48] [GameBot] [Twitter]: [#IRC-Wiki@ircwiki] (following): ircjunkie, InsideIRC, NerdHerdIRC, jflusmanjr, ircpowerscl, OW_IRC, citrixirc, eLeetIRC, theirctrout, furnet, geekupirc, ircbrasil, rev3irc, infrabot, techgeek93, auronianews, frigidtech, RussellB28, xTremeGeekIRC, ConflictIRC
[20:01:49] [GameBot] [Twitter]: [#IRC-Wiki@ircwiki] (following): Incredibots, synirc, lightIRC, colloquyapp, owircnet, VillageIRC, 6667irc, FlowChat, SwiftBNC, WebChatIRC, WMnetwork, devilsfreek, freenodestaff, espernet, ngIRCd, EvonyIRC, wikkedwire, xTremeIRC, TECLifeIRC, DefconIRC
[20:01:52] [GameBot] [Twitter]: [#IRC-Wiki@ircwiki] (following): GeeksIRC, LobbyZNC, crypthon_ircnet, BNC4FREE, NoAgendaChat, WyldRyde, InfinityIRC, alphairc, SassIRC, solidirc, SwiftIRC, FknBish, trixarian, gigchat, QuoteBucket, ircjunkieorg, TheBotsirc, HawkeeBot, IRCHighWay, mibbit
[20:01:55] [GameBot] [Twitter]: [#IRC-Wiki@ircwiki] (following): Hawkee, twitter, pastebincom, Fighterlegend, hyruledotnet, DDuckieDD, Lyhne1, Joah1991, Straightos, IRCReport, pumford10, ahylianhuman, NixtrixIRC, TornadoIRC, InnerIRC, zncbouncer, GeekShed, qdb, RScript
[20:02:11] [&Trixar_za] +follow gignet
[20:02:13] [GameBot] [Twitter]: Successful Follow: [Nessy Rayne@gignet] (1 Friends; 2 Followers) @ http://twitter.com/gignet
[20:02:23] [&Trixar_za] -follow gignet
[20:02:25] [GameBot] [Twitter]: Successful Unfollow: [Nessy Rayne@gignet] (1 Friends; 2 Followers) @ http://twitter.com/gignet
[20:02:27] [GameBot] @Mention 23w, 1d, 20h, 26m, 39s ago (11787726626@vipa5000) (Terrance Robotham): @IRCWiki Useful IRC Sites (http://www.irc-wiki.org/IRC+Sites) > http://archives.darenet.org"}
[20:02:39] [&Trixar_za] nice
[20:03:04] [&Trixar_za] !tweet Hopefully the bot is working now and you all can see this tweet
[20:03:06] [GameBot] [Twitter]: OAuth failed: (401) Request: /1/statuses/update.json; Error: incorrect signature |
_________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Sep 17, 2010 2:32 pm Post subject: |
|
|
| Trixar_za wrote: | [20:03:04] [&Trixar_za] !tweet Hopefully the bot is working now and you all can see this tweet
[20:03:06] [GameBot] [Twitter]: OAuth failed: (401) Request: /1/statuses/update.json; Error: incorrect signature |
I'm betting this is an http-package versioning (fragmentation) problem. Eggdrop has tons of these. Try just:
!tweet oneword
If this works, it's definitely the issue of spaces being treated as +'s rather than as %20's. I prefer to treat them as what they are %20's.
But, I won't leave you hanging. We can solve this possibly. By "we" I mean, you need to do some work investigating too. To do this investigating, I can give you a proper debug version of oauth.tcl. Replace oauth.tcl with oauth-debug.tcl renaming it. Afterwards, watch your query window. After you !tweet your bot will begin a series of messages to you. These will help figure out exactly where in the OAuth process things are being mangled. The most IMPORTANT parts to know are: OAUTH_RAW, OAUTH_HEADER, BASE_STRING and MY_QUERY. Of course obscure your oauth tokens if you care not to disclose them. The part I want to see involves the sort-order to the oauth_header and oauth_raw, as well as how the oauth_header matches up to my_query.
| Quote: | # Incorrect signature, other errors pissing you off.
# Get the inside look at every oauth transaction via query
# set your debug nick here
set oauthdebug "" |
The debug version has this setting within it. You need to add your nickname where it has "". When we solve it, you can change this back to "" and continue to just use the debug version rather than switch back to the orignal oauth.tcl.
Anyone else using this script successfully? Chime in please.
Anyone else using this script unsuccessfully? Chime in as well.  _________________ speechles' eggdrop tcl archive
Last edited by speechles on Fri Sep 17, 2010 3:08 pm; edited 1 time in total |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Sep 17, 2010 3:05 pm Post subject: |
|
|
EDIT: Clearned so people can't abuse the info  _________________ http://www.trixarian.net/Projects
Last edited by Trixar_za on Fri Sep 17, 2010 5:29 pm; edited 1 time in total |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Sep 17, 2010 3:24 pm Post subject: |
|
|
| Trixar_za wrote: | Here you go:
In the channel: | Code: | [21:02:58] [&Trixar_za] !tweet one
[21:03:22] [GameBot] [Twitter]: OAuth failed: (401) Request: /1/statuses/update.json; Error: incorrect signature |
In private: | Code: | | [21:03:22] [GameBot] my_query status=%3CTrixar_za%3E+one |
|
AHA! On speaking with a twitter API developer advocate, it seems that http package has indeed undergone a change in it's versioning. The version of http package I'm using (2.5.3) encodes spaces as %20's. This is how twitter wants them. It is confusing having them as +'s. The version your using, is encoding them as +'s. This is evident by your my_query line above.
| Code: | | my_query status=%3Cspeechles%3E%20testing |
Mine on the other hand, is using %20. This is one of the problems on using libraries. If you can confirm this and give the http package version your using this can then be easily solved. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Sep 17, 2010 4:28 pm Post subject: |
|
|
By the looks of it, I'm using http package 2.5.2 - so there must have been one hell of a change between 2.5.2 and 2.5.3 to present this issue hey?
| Code: | % puts $tcl_version
8.4
% package require http
2.5.2 |
_________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Sep 17, 2010 4:33 pm Post subject: |
|
|
| Trixar_za wrote: | | By the looks of it, I'm using http package 2.5.2 - so there must have been one hell of a change between 2.5.2 and 2.5.3 to present this issue hey? |
| Code: | # These are handled specially
array set map { " " + \n %0d%0a }
variable formMap [array get map] |
Find the above in your copy of http.tcl
it's located in either: /lib/tcl8.4/ --or-- /lib/tcl8.4/http2.5
Change it to look like it is below:
| Code: | # These are handled specially
set map(\n) %0d%0a
variable formMap [array get map] |
This is the BIG change that occured that basically broke it. Changing this will fix it all and you will be solved.  _________________ speechles' eggdrop tcl archive
Last edited by speechles on Fri Sep 17, 2010 4:45 pm; edited 2 times in total |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Sep 17, 2010 4:43 pm Post subject: |
|
|
| Quote: | % set value [http::formatQuery "this is my text"]
this+is+my+text
% set value [http::formatQuery "this"]
this |
_________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Sep 17, 2010 4:45 pm Post subject: |
|
|
see my above post, you beat me to the edit..
Make sure to set the oauth debugnick to "" again and .rehash your bot. Sending all those debug messages will slow your bot down considerably. _________________ 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
|
|