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
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Football wrote:So it will work if I:

+track "Love" OR "Hate" OR "Jealous" OR "Dignity"

?
<speechles> !tsearch "Love" OR "Hate" OR "Jealous" OR "Dignity"
<sp33chy> ( 4-1 ) Search timelines ( #kangaroopocket@suqmuhnutz ):
<sp33chy> PolarTercio: I love this NEW App, it shows me who "stalks" my twitter! http://bai.lu/149bm ( 92156220005302272@PolarTercio - 0s ago via web )
<sp33chy> _renee_johnson: @jakubandrew Are you and HeyHiHello coming to Australia anytime soon ? I would love to see you perform (: ( 92156220391178240@_renee_johnson - 0s ago via web )
<sp33chy> laraissilly: i love your existence :) ( 92156220525387776@laraissilly - 0s ago via web )
<sp33chy> taylorbonnd12: I LOVE @jessiejofficial smuch! <3 ( 92156220563132416@taylorbonnd12 - 0s ago via Twitter for Android )
If it works with !tsearch and you see results. Track will as well. But track keeps "track" of where it leaves off. So if you expect +track to match !tsearch at certain times it wont. As tracking "remembers" where it left off. So switch tracks, will not show older things. It's trying to keep you up to date with +track, not spam you with things no longer relevant. The key here is to experiment. Try things. Use imagination. Does the above work for you?
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Yes it does, thanks again man. Great stuff.
Idling at #Football, Quakenet.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

hey speechless, another fix for the next version:
[12:01:29] <@User> +follow nanyabola
[12:01:31] <@Soccer> Successful Follow: [nanyabola@nanyabola] (2 Friends; 600 Followers) @ http://twitter.com/nanyabola
[12:01:52] <@User> +follow nanyabola
[12:01:54] <@Soccer> Successful Follow: [nanyabola@nanyabola] (2 Friends; 600 Followers) @ http://twitter.com/nanyabola
Idling at #Football, Quakenet.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Football wrote:hey speechless, another fix for the next version:
[12:01:29] <@User> +follow nanyabola
[12:01:31] <@Soccer> Successful Follow: [nanyabola@nanyabola] (2 Friends; 600 Followers) @ http://twitter.com/nanyabola
[12:01:52] <@User> +follow nanyabola
[12:01:54] <@Soccer> Successful Follow: [nanyabola@nanyabola] (2 Friends; 600 Followers) @ http://twitter.com/nanyabola
Actually, truth be told. That is a feature. Same as being able to unfollow someone your currently not following. Many twitter apps also keep this nature. So correcting it requires an extra call to poll your friends, to see if the person is already there or not before making the 2nd request to + or - follow that user. This can dramatically consume your rate calls having it cost 2 points to do this, and doing it often enough. Considering the script with all of it "on" consumes merely 180 requests an hour. The limit for oAuth enabled applications is 350 calls per hour. So, perhaps it isn't so dramatic, there's still 170 or so left. It's still annoying to make 2 calls for every !query, at least to me.. heh ;)

In short, it's supposed to work like that because twitter themselves don't throw an API error when you request to do this.
K
Kiru
Voice
Posts: 8
Joined: Wed Feb 27, 2008 8:02 pm

Post by Kiru »

Just wanted to say thanks for this great script, speechles!
i
iRoc

Post by iRoc »

4:37:29pm/ * <iRoc> !tweet (FRIENDLY GAMES - Club Friendly) Podbeskidzie Vs Widzew Lodz: 0-1 2nd Half Started
4:37:30pm/ * <iB0T> unable to convert date-time string "2011-07-19 16:37:29 +0600": syntax error (characters 25-25)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

iRoc wrote:4:37:29pm/ * <iRoc> !tweet (FRIENDLY GAMES - Club Friendly) Podbeskidzie Vs Widzew Lodz: 0-1 2nd Half Started
4:37:30pm/ * <iB0T> unable to convert date-time string "2011-07-19 16:37:29 +0600": syntax error (characters 25-25)
In oauth.tcl find this section:
# 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"
Change that to resemble this:
# 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"
This should solve it. This happens with some platforms. Hence that oauth_time setting that fixes it.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

hey speechless,

[10:31:36] <@BarraBrava> (Physioroom.com Ltd): Etherington Boost For Stoke - He has traveled and could play tonight despite having no feeling in his arm on Sunday http://t.co/qYwpKIG"

Any idea why I`m getting that inverted comma at the end of the tweet every single time? Also wondering if a new version will be released soon?
Idling at #Football, Quakenet.
o
okee
Voice
Posts: 1
Joined: Sun Aug 21, 2011 9:43 am

Post by okee »

Football wrote:hey speechless,

[10:31:36] <@BarraBrava> (Physioroom.com Ltd): Etherington Boost For Stoke - He has traveled and could play tonight despite having no feeling in his arm on Sunday http://t.co/qYwpKIG"

Any idea why I`m getting that inverted comma at the end of the tweet every single time? Also wondering if a new version will be released soon?
I have this problem too! Also, fixMyDuration doesn't seem to work.
Also, getting this error in partyline: Tcl error [proc:twitter:followers:auto]: wrong # args: should be "string map ?-nocase? charMap string"
x
x-y-no
Voice
Posts: 7
Joined: Sun Aug 09, 2009 12:13 pm
Location: Fort Lauderdale, FL

Post by x-y-no »

Hi speechles,

First of all thanks for this great script - I've been using it for a while and up to now it has worked great. Lately, however, I'm having these two problems, which I assume are related:

In dcc, I get:

Code: Select all

[Twitter]: OAuth failed: (???) Unknown problem... No reason given...( timeout )
and occasionally:

Code: Select all

Tcl error [proc:twitter:friendsauto]: can't read "t1": no such variable
I tried increasing the timeouts in oauth.tcl to 10000 (from 5000) and the first error message goes away, but then I get the second message every time.

It seems to me I'm probably getting some kind of error response from twitter, but it's beyond my skill with tcl scripting to dig down into the code and figure out just what is happening.

BTW I'm getting essentially nothing in the twitter enbled channels, but it still responds correctly to queries like !friends, !followers and so on ...
x
x-y-no
Voice
Posts: 7
Joined: Sun Aug 09, 2009 12:13 pm
Location: Fort Lauderdale, FL

Post by x-y-no »

UPDATE:

Replacing this in proc:twitter:jsondecode:restapi

Code: Select all

			if {[string length $t1]} {
				if {[string length $r1] != [string length $t1]} {
					set t "$ck $t1"
				}
			}
with this:

Code: Select all

			if { [info exists t1] } {
				if {[string length $t1]} {
					if {[string length $r1] != [string length $t1]} {
						set t "$ck $t1"
					}
				}
			}
appears to have solved the problem.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Yeah, seems twitter has been adding new API elements left and right and this caused some slight problems with my pre-arranged json parsing. You see, it isn't pretty nor is it trying to actually build an array pseudo-dict style to hold the json elements. This is brute force regexp and knowing ahead of time how the json is constructed for each query. Now the brute force doesn't work when that arrangement changes. So each time twitter changes things, I start to think more and more about writing my own json parser to do this and store entities into a mapped array. It would be much easier at a certain point to do this than struggle with constant flux and this brute forcing. Soon it will be this way.


But.. About those issues.

>> Fixed is that dangling " at the end of every tweet shown.
<zsh> The Miz: I'm trending...I'm trending!!! Cheap pop 3" ( 108366574263611393@mikethemiz - 1m, 2s ago via UberSocial for BlackBerry )
<sp33chy> ESPN: Ni Hao! Wilson Chandler says he has signed a contract to play in China, binding him there even if NBA lockout ends: http://t.co/QOOooIr ( 108367170479718401@espn - 56s ago via TweetDeck )
Here is a quick side by side. Top bot has that problem notice that dangling ". Bottom bot is mine running new version. :)

>> Fixed is that error regarding [string map]
That one was easier. I forgot that when constructing my
  • fields that when building replacements, to encapsulate them within " ", they have spaces using " " is required to keep them as a single replacement and paired. This is now corrected.

    >> Fixed is that t1 error.
    Problem there isn't merely that [info exists] check. Which I've now added indentically. The problem is the bot was "cut-off" in retrieving html. The timeout cut it off so it didn't get the entire json payload twitter sent. So all this does is keep the parsing errors at bay. There is still a problem with either the bots connection to twitter. Being it either them or you. But it's rare this should happen, and predictable to tell. Does twitter on the web timeout too? If so, yeah, its twitter.

    I've also fixed the lingering issue with ID sorting. You may have noticed that your friends tweets were missing any retweets they had made. This will no longer happen. Retweets will be diligently shown if they are indeed new.

    There were other issues fixed as well. But I've long forgot what these were. Suffice to say they were mainly behind the scenes things that only affected logic, not really display elements. What that means is more things should behave correctly at all times now. Not sporadically.

    Get the new script here: Birdy 5.05c
    From here on out, all releases shall simply be linked to the name "Birdy" along with its version number. Don't be confused, it still has oauth, twitter, tweets with megahal. It just isn't as catchy a name leaving all that there. Birdy just sounds better by itself. Birdy for Eggdrop. It sounds sexier.

    NOTE: I have yet to correct the functionality of !friends/!followers as well as the "auto" follower detection of new/lost followers to go beyond 100. So if you have more than 100 friends, or follow more than 100 people. They won't all be listed. This will be corrected soon. The way to achieve this is now much more complicated, and the current method is on the "deprecated/soon to be removed" list of their RESTAPI features. So the migration to using the other methods will take place sooner rather than later to avoid total deprecation. Until then... Hopefully, nothing else changes or causes issues for anyone...
r
romprod
Halfop
Posts: 49
Joined: Fri Oct 19, 2001 8:00 pm

Post by romprod »

Hi, great script!

Is there a way to make certain accounts that I'm following appear in certain channels only, to filter them out? I would like to do it this way so that I don't spam users with tweets they wouldn't want to read.

Thanks.
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

hey speechless,

getting this error
[12:48] OAuth failed: (401) Error: could not authenticate with oauth.; Request: /1/statuses/mentions.json?include_rts=1 ( ok )
Why is that? whats wrong?
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:hey speechless,

getting this error
[12:48] OAuth failed: (401) Error: could not authenticate with oauth.; Request: /1/statuses/mentions.json?include_rts=1 ( ok )
Why is that? whats wrong?

Code: Select all

# 4) --> ACCOUNTS SETTINGS <--

# Accts to tweet to
# "#channel|Login|Consumer_key|Consumer_secret|Access_token|Access_token_secret[|tweet-format]"
# --
# Channel name here uses lowercase, your actual
# channel case is irrevelant. But here you must
# use lowercase only
# --
# tweet-format is entirely optional and used as
# an optional local over-ride. If no tweet-format
# is given the globaltwitterformat will be used.
# --
# 	
# (list)
set twitter(accts) {
	"#chan1|acct1|consumer_key1|consumer_secret1|access_token_key1|access_token_secret1"
	"#chan2|acct2|consumer_key2|consumer_secret2|access_token_key2|access_token_secret2"
	"#chan3|acct3|consumer_key3|consumer_secret3|access_token_key3|access_token_secret3"
}
<speechles> !mymentions
<sp33chy> OAuth failed: (401) Error: could not authenticate with oauth.; Request: /1/statuses/mentions.json?count=200&include_rts=1 ( ok )
This happens when you've used incorrect Consumer Token (consumer key), and Consumer Secret Key (consumer secret). The first two keys in the accounts set up. These track the application. So in short, you made a typo in attaining the first 2 keys. These must be exact identical copies, usually best to copy/paste into the script.
<speechles> !mymentions
<sp33chy> OAuth failed: (401) Error: invalid / expired token; Request: /1/statuses/mentions.json?count=200&include_rts=1 ( ok )
If you ever see this. It means the last 2 keys in the accounts set up are incorrect. These are the two used to latch onto your channels account. These are the OAuth Token (access token key), and OAuth Secret (access token secret).

Hopefully this answers the question. ;)
Post Reply