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
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

Works great! thanks!
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

I have updated my eggdrop version and now encounter this problem:

conflicting versions provided for package "base64": 2.3.2, then 2.4.1
while executing
"package provide base64 2.4.1"
(file "scripts/base64.tcl" line 379)
invoked from within
"source scripts/base64.tcl"
(file "Reddit.conf" line 1387)
* CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
What should I do?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

BigToe wrote:I have updated my eggdrop version and now encounter this problem:

conflicting versions provided for package "base64": 2.3.2, then 2.4.1
while executing
"package provide base64 2.4.1"
(file "scripts/base64.tcl" line 379)
invoked from within
"source scripts/base64.tcl"
(file "Reddit.conf" line 1387)
* CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
What should I do?
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
It appears, you already have base64. There is no need to source it as shown above.
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

Thanks speechles,

But how do I know if I have tcl lib installed?
x
xelanis
Voice
Posts: 2
Joined: Wed Mar 13, 2013 1:21 am

Post by xelanis »

Hello!

Script work fine with GET requests. +/-follow,+/-app,!followers,!mymenitons command run and authorize correctly.
But, !tweet someone do not work with error: OAuth failed: (401) Error: could not authenticate with oauth.; Request: /1/statuses/update.json ( ok )

Why?

PS consumer_key/secret and oauth_token/secret are copied correctly from Apps page. GET requests work with this key/secret and auth correct.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

xelanis wrote:Hello!

Script work fine with GET requests. +/-follow,+/-app,!followers,!mymenitons command run and authorize correctly.
But, !tweet someone do not work with error: OAuth failed: (401) Error: could not authenticate with oauth.; Request: /1/statuses/update.json ( ok )

Why?

PS consumer_key/secret and oauth_token/secret are copied correctly from Apps page. GET requests work with this key/secret and auth correct.
The problem is your http package version.. It is incorrectly encoding spaces as + instead of %20. The OAuth specification requires double encoding of the status body for a tweet. A + when double encoded will remain + but.. A (space) when encoded becomes %20, when double encoded this become %2520.

Find the setting below in oauth.tcl:

Code: Select all

# Incorrect signature, other errors pissing you off.
# Get the inside look at every oauth transaction via query
# set your debug nick here
set oauthdebug ""
Put your nickname for the value of oauthdebug. ( set oauthdebug "yournick" ) then .rehash your bot after making this change, and quickly !tweet something with spaces like the example below, then quickly re-edit oauth.tcl and change the oauthdebug setting back to "" and issue a .rehash

now...scroll back, and look for the debug for your tweet. It should look something similar to what you see of mine below (keep in mind when debug is enabled you will see all of it's oauth transactions, even it's automations. This is why you have to quickly do the above.. heh):
<speechles> !tweet hello world testing testing 1.. 2.. 3..
<bot> Tweet created: http://twitter.com/suqmuhnutz ( 311717362040729601@suqmuhnutz - 0s ago via bittersweet )
The debug should look like below:
<bot> oauth:query_api http://api.twitter.com/1/statuses/update.json ilwnjqhNsiCAn94mZXTAzQ q2gIVG5S2BWfVbN5zcsu8JdRY127r7j0sSXTN6iC4 POST 109926964-zVU1XqmBfabzl8PmWRt5OaAz3XXiQLgvLHR7phZU PWCqKOBrgmWkRURTnO6EeurytaSSVcBNbkTbyKY {status %3Cspeechles%3E%20hello%20world%20testing%20testing%201..%202..%203..}
<bot> oauth_raw {oauth_consumer_key ilwnjqhNsiCAn94mZXTAzQ} {oauth_nonce 51ac91718e93d294098d92520cb4ac5e001ba7a1} {oauth_signature_method HMAC-SHA1} {oauth_timestamp 1363154272} {oauth_token 109926964-zVU1XqmBfaaSl8Pmlat5OaAz3XXLgvLHR7phZU} {oauth_version 1.0}
<bot> oauth_raw_sign {oauth_consumer_key ilwnjqhNsiCAn94mZXTAzQ} {oauth_nonce 51ac91718e93d294098d92520cb4ac9e001ba7a1} {oauth_signature_method HMAC-SHA1} {oauth_timestamp 1363154272} {oauth_token 109926964-zVU1XqmBfaaSl8PmTFt5OaAz3XXLgvLHR7phZU} {oauth_version 1.0} {status %3Cspeechles%3E%20hello%20world%20testing%20testing%201..%202..%203..}
<bot> base-string POST&http%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fupdate.json&oauth_consumer_key%3DilwnjqhNsiCAn94mZXTAzQ%26oauth_nonce%3D51ac91718e93d294098d92520cb4ac5e001ba7a1%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1363154272%26oauth_token%3D109926964-zVU1XqmBfaaSl8PmWRt5OaAz3XXiQLgvLHR7phZU%26oauth_version%3D1.0%26status%3D%253Cspeechles%253E%2520hello%2520world%2520testing%2520testing%25201..%25202..%25203
<bot> signature SkZ0AA5yY7XUhfS57Zbg9n6IvBg=
<bot> oauth_raw {oauth_consumer_key ilwnjqhNsiCAn94mZXTAzQ} {oauth_nonce 51ac91718e93d294098d92520cb4ac5e001ba7a1} {oauth_signature SkZ0AA5yY7XUhfS57Zbg9n6IvBg=} {oauth_signature_method HMAC-SHA1} {oauth_timestamp 1363154272} {oauth_token 109926964-zVU1XqmBfaaSl8PmWRt5OaAz3XXLgvLHR7phZU} {oauth_version 1.0}
<bot> oauth_header oauth_consumer_key="ilwnjqhNsiCAn94mZXTAzQ",oauth_nonce="51ac91718e93d294098d92520cb4ac5e001ba7a1",oauth_signature="SkZ0AA5yY7XUhfS57Zbg9n6IvBg%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1363154272",oauth_token="109926964-zVU1XqmBfaaSl8PmWRt5OaAz3XXLgvLHR7phZU",oauth_version="1.0"
<bot> my_query status=%3Cspeechles%3E%20hello%20world%20testing%20testing%201..%202..%203..
I've changed of course my tokens in the spots to discourage abuse. But the parts you need to be concerned with are:
<bot> oauth:query_api http://api.twitter.com/1/statuses/update.json ilwnjqhNsiCAn94mZXTAzQ q2gIVG5S2BWfVbN5zcsu8JdRY127r7j0sSXTN6iC4 POST 109926964-zVU1XqmBfabzl8PmWRt5OaAz3XXiQLgvLHR7phZU PWCqKOBrgmWkRURTnO6EeurytaSSVcBNbkTbyKY {status %3Cspeechles%3E%20hello%20world%20testing%20testing%201..%202..%203..}
At the end of the "oauth:query_api" line is the status. Notice the %20's present. Also:
<bot> my_query status=%3Cspeechles%3E%20hello%20world%20testing%20testing%201..%202..%203..
The "my_query" line should look the same.
base-string POST&http%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fupdate.json&oauth_consumer_key%3DilwnjqhNsiCAn94mZXTAzQ%26oauth_nonce%3D51ac91718e93d294098d92520cb4ac5e001ba7a1%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1363154272%26oauth_token%3D109926964-zVU1XqmBfaaSl8PmWRt5OaAz3XXiQLgvLHR7phZU%26oauth_version%3D1.0%26status%3D%253Cspeechles%253E%2520hello%2520world%2520testing%2520testing%25201..%25202..%25203
The end of the "base-string" should contain the %2520's showing that yes, the spaces were indeed correctly double-encoded.

I discourage using anything previous to HTTP Package 2.5.3. So do not use version 2.5.0, 2.5.1 or 2.5.2. I also discourage using anything under 2.7.5 if using the 2.7.x branch. These versions will cause issues with http transactions.
x
xelanis
Voice
Posts: 2
Joined: Wed Mar 13, 2013 1:21 am

Post by xelanis »

Thanks.

After install 2.7.10 backport to 8.4 all work fine.
T
TeknoJuce
Voice
Posts: 4
Joined: Mon Nov 26, 2012 2:08 am

party line errors

Post by TeknoJuce »

Version: EggDrop 1.6.21 - twitter.tcl 5.05c

I don't have anything set here (or anyplace else in the eggdrop.conf):

Code: Select all

# To add a channel to eggdrop, please enter the bot's partyline and type
# .+chan #channel. Check also .help chanset and .help chaninfo.
# You can still add a channel here and it will be saved if you have a
# chanfile. We recommend you to use the partyline though.
#
# channel add #foo

#### SERVER MODULE ####
etc...
I've set:

eggdrop.conf

Code: Select all

source scripts/sha1.tcl
source scripts/base64.tcl
source scripts/oauth.tcl
source scripts/twitter.tcl
Partyline

Code: Select all

.+chan #unlab
.+chan #unlondon
.chanset #unlab +twitter
.chanset #unlondon +twitter
.chanset #unlab +twittertrack 
.chanset #unlondon +twittertrack 
.chanset #unlab -twittermentions
.chanset #unlondon -twittermentions
.chanset #unlab -twittermega
.chanset #unlondon -twittermega
.chanset #unlab -twittermentionsmega
.chanset #unlondon -twittermentionsmega
.chanset #unlab -twitterfriends
.chanset #unlondon -twitterfriends
.chaninfo #unlab

Code: Select all

<unLabBot> User defined channel flags:
<unLabBot>      +durby +google -spokesecret +twitter
<unLabBot>      -twittermega -twittermentions -twittermentionsmega -twitterfriends
<unLabBot>      +twittertrack -twitterfollowers

Code: Select all

.chaninfo #unlondon
<unLabBot> User defined channel flags:
<unLabBot>      +durby +google -spokesecret +twitter
<unLabBot>      -twittermega -twittermentions -twittermentionsmega -twitterfriends
<unLabBot>      +twittertrack -twitterfollowers
PartyLine

Code: Select all

<unLabBot> [18:10:00] Tcl error [proc:twitter:followers:auto]: no such channel record
<unLabBot> [18:10:01] Tcl error [proc:twitter:trackauto]: no such channel record
<unLabBot> [18:10:01] Tcl error [proc:twitter:friendsauto]: no such channel record
<unLabBot> [18:10:01] Tcl error [proc:twitter:megahal:privatereply]: no such channel record
<unLabBot> [18:10:01] Tcl error [proc:twitter:megahal]: no such channel record
I only want to use the tracker part of the script nothing else, I tried to plus all the others and it still kept complaining on the partyline and .rehash didn't help.

Just to note I know I set up the tracker part properly as tweets are getting vomited into the chat channel with just the specific search phrases.

I've tried to !tweet as well but it errors out like the above person:

Code: Select all

<NonaSuomy> !tweet test010101110
<unLabBot>  OAuth failed: (401) Error: read-only application cannot post; Request: /1/statuses/update.json ( ok )
haven't had a moment to look into that as it's hard for me to follow how to debug the situation.

Any help to squash these errors would be great, thanks for your time.
X
Xelas
Voice
Posts: 2
Joined: Wed Oct 19, 2005 9:37 am

Post by Xelas »

Hi.

Please, tell me how modify twitter(restapi-display) template to display screen_name of user who retweet message, but not author of retweeted message.

Example: now template set as:

Code: Select all

set twitter(restapi-display) "\002@%screen%\002: %text%\017"
in channel I see
@Simanchev: RT @Simanchev: some text.
but originally this tweet retwitted by @tweeter_knitter and I was hoping to get
@twitter_knitter: RT @Simanchev: some text.
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

hello speechles,

I wanted to know if there is a way with your script, to pull a username's numeric ID?

i.e

Something like

!numericID <username here>

will return his numericID + can this be included when using +track?
User avatar
Ankara
Voice
Posts: 2
Joined: Sat Oct 13, 2012 4:33 pm

Post by Ankara »

Noticing today with the retirement of api v1, getting an OAuth error:

Code: Select all

OAuth failed: (410) <?xml version=1.0 encoding=utf-8?><errors> <error code=68>the twitter rest api v1 is no longer active. please migrate to api v1.1. https: //dev.twitter.com/docs/api/1.1/overview.</error></errors> ( ok )
Was trying to fix it myself, but I can't seem to find the problem.

EDIT:
Think I found it: when I enabled debugging, the first thing I noticed was this:

Code: Select all

oauth:query_api http://api.twitter.com/1/statuses/user_timeline.xml 
I remembered that support for xml was dropped in favor of JSON. from the twitter overview page:

Code: Select all

API v1.1 will support JSON only. We've been hinting at this for some time now, first dropping XML support on the Streaming API and more recently on the trends API. We've chosen to throw our support behind the JSON format shared across the platform. Consequently, we've decided to discontinue support for XML, Atom, and RSS, which are infrequently used today.
Going to try some modifications to the timeline URLs in the main Birdy script to see if that fixes anything. will post my results once I have some
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Ankara wrote:Noticing today with the retirement of api v1, getting an OAuth error:

Code: Select all

OAuth failed: (410) <?xml version=1.0 encoding=utf-8?><errors> <error code=68>the twitter rest api v1 is no longer active. please migrate to api v1.1. https: //dev.twitter.com/docs/api/1.1/overview.</error></errors> ( ok )
Indeed... I salute v1.0 of the twitter api. May she rest in peace. She served us well. It's a sad day in twitter-verse, because thousands of other applications also cried out in pain today, and died their own silent deaths. Unforunate, but all good things must come to an end. This script on the other hand.....moves onto v1.1 today. :D

So what I've done, is try to clean up as much as possible and get working the primary functions of the script. The automations to relay in friends/mentions/track are fully working. The automations for megahal are not. The triggers which will not work at the moment:
  • !friends this endpoint is gone in v1.1. It must now be obtained by 2 fetches for what used to take 1. Needs work.
  • !followers same reason as above why it's broken. Work here too.
  • !rtbyme this timeline is no longer supported by twitter at all. Gone.
  • !rttome this timeline is no longer supported by twitter at all. Gone.
  • !rate v1.1 rate status is now done on a per endpoint allocation quota and uses 15 minutes as the reset period. this is entirely different than v1.0. Needs work.
  • !twitter this was broken previously, this will be fixed. Needs love.
  • !public this timeline is no longer supported by twitter at all. Gone.
Taking this into account. This script is now in BETA form.
Birdy (OAuth, Twitter, Tweets&MegaHAL v6.01d) Jun12,2013

Also, do not enable megahal in this release...
Once more for those just tuning in...
DO NOT ENABLE MEGAHAL IN THIS RELEASE (v6.01d)
.chanset * -twittermega -twittermentionsmega

The megahal was still using the old xml payload twitter offered under v1.0. With the new v1.1 xml is no longer supported. I will update the megahal parser to work with the new json endpoints as well. Expect there to be minor display issues here and there occasionally. These are caused by slight differences in the 1.1 vs 1.0 payloads. These can fixed as well. It just takes time, hence moving this script into BETA status for the moment.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

magnificent and just on time, as usual, speechles!

Well done, great work!
Idling at #Football, Quakenet.
h
hicks
Voice
Posts: 9
Joined: Wed Dec 19, 2007 3:22 pm

Post by hicks »

I get up this morning, realise I'm getting errors. I go to work. I get home, and you've already fixed it.

Thank you so much, speechles. Legend :D
h
hicks
Voice
Posts: 9
Joined: Wed Dec 19, 2007 3:22 pm

Post by hicks »

Ah. Except I'm getting this error in partyline and in channel "OAuth failed: (???) Unsupported URL type "https" ( internal error )" :(

Used new script as it was, except I pasted in key/secret etc in twitter(accts) section from old script. Guessing this is something odd to do with my own setup.
Post Reply