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.

A simple tweeter..

Help for those learning Tcl or writing their own scripts.
Post Reply
d
dj-zath
Op
Posts: 134
Joined: Sat Nov 15, 2008 6:49 am
Contact:

A simple tweeter..

Post by dj-zath »

How simple?

first off, I apologize if this is in the wrong place.. after posting it twice before- here, and in "script request".. I realized its best here..

I'm not asking for a script, just some pointers on how Twitter handles a login..

the idea I have is to have my eggie "post a tweet" each time the broadcast server comes online and then tweet the show name.. or, if the show changes, then display the show name (if new) again..

I have all the code in place except the actual "login" procedure itself

I have looked at the megahal script thats being featured all over here.. (NICE WORK btw!) but thats far too advanced for what I need at this time.. I just need a simple "announcer" so the bot can tweet that shows have begun...

Heres what I have puked up in the last few mins so far, note: this is only a "partal" script- the "logic" of the thing is allready handled somewhere else; but I post this so that you have a better understanding of what I need :)

please note- I JUST spewed this out moments ago.. so this is EXTREMELY basic (and I'm sure its full of errors/will NOT work in this state) but here it is anyways:

Code: Select all

## Update Twitter ##

if {(Csh06 != "$DetIA $DetSA $Show")&&(![catch {

exec curl --basic --user "$user:$pass" --data-ascii \
  "status=$Show" http://twitter.com/statuses/update.json >& /dev/null &

};])} {
        set Cs$h06 "$DetIA $DetSA $Show";
        putlog "Twitter Updated!";
};

notice I don't use the http module here.. (did they ever fix the "non-working timeout issue" yet?)

... a work in progress!

-DjZ-
:) :)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Unfortunately, using basic auth logon will not work after June 30th 2010:
http://dev.twitter.com/pages/auth wrote:As of June 30, 2010, basic auth (directly passing a username and password for every API request) will no longer be supported. Web applications are encouraged to use full OAuth to authenticate users and act on their behalf. Desktop and mobile applications are encouraged to use OAuth. Mobile and desktop applications are also given the opportunity to use xAuth, a means to exchange a login & password for an access token. To use xAuth, send a request to api@twitter.com with plenty of details about your application and why xAuth is the best choice for it.
NML_375
d
dj-zath
Op
Posts: 134
Joined: Sat Nov 15, 2008 6:49 am
Contact:

Post by dj-zath »

oh!

hi Nml!

oh, that figures! (about the auth) lol

but if that will help kill spam.. then I'm all for it.. (even though then I'm dead in the water here)

How are you? I hope you're doing well today.. oh, and thanks for all your help.. its greatly-appreciated!

-DjZ-
:) :)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Well...
Spent the morning at the shooting-range - feels great
Having an injured right thumb since a few weeks now - feels not so great

There is the OAuth authentication still, probably takes somewhat more work, but you should be able to use curl for that..
NML_375
d
dj-zath
Op
Posts: 134
Joined: Sat Nov 15, 2008 6:49 am
Contact:

Post by dj-zath »

about Oauth..

I'm not sure where to begin.. any quick pointers or shall I get crackin' with some googling?

about the sore thumb:

a few weeks? ouch! I can understand.. with the thumb being "out" you now realize just how much you actually USE it.. (same for the big toe...)

once I had a mishap where the nail was torn from the cuticle... okay.. I better not say anymore! heheh

oh1 one other thing.. I tried to go to the irc server in your siggy.. one of 2.. one seemed a personal site (they surely got all my net details) and the other in the netherlannds... same applies... I'm still not sure where "ircNET" is <feeble smile> :)

-DjZ-
:) :)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

http://dev.twitter.com might be a good place to start..
Got pretty much all the docs on how to use the Twitter API with your own application

Re Thumb: Gets better as I just got put off the painkillers... though I'm seeing the doc tomorrow.. Not so keen on writing long posts at the moment, as you might imagine.

Re Ircnet: It is or was one of the top three largest networks in the days.. IrcNET, DalNet, and EF-Net as I recall.. Though ircnet never caught as much attention in the states. irc.stealth.net might still be linked though..
But, as the sig says.. I'm mostly idling there
NML_375
d
dj-zath
Op
Posts: 134
Joined: Sat Nov 15, 2008 6:49 am
Contact:

Post by dj-zath »

re: long posts (and pain killers)

yeah.. I don't want ya to put yourself in any pain on my account.. being once fallen 30 feet from a radio tower and smashing both femurs and fracturing the pelvis.. I can SURELY understand the pain you are feeling.. especially being taken off the pain killers (they had me on viccadin and opium) the worst, though, occurred AFTER they took me off... (it might be best to not disclose details here, but I'll say this much.. noone told me that I'd be constapated for almost 3 WEEKS...)

I STILL cringe in horror at that thought!

re: ircNET:

I tried irc.net, ircnet.net, ircnet.org and ircnet.com.. 2 didn't resolve to anything- the other two connected to somewhat "doesn't seem lagiit" places (including one that took over my client and started exec'ing different modes! good thing I had the ini backed up...)

re: dev.twitter.com
I'll defo have a looksee there and see what I can figure out/come up with :) again I appreciate all the help you have given.. you're a good person.. and I owe you a keg now! :)

-DjZ-
:) :)
d
dj-zath
Op
Posts: 134
Joined: Sat Nov 15, 2008 6:49 am
Contact:

Post by dj-zath »

I'm cirrently talking to the geeks on freenode.net

it seems that Twitter is NOT INTERESTED in anything non-java (or not windows based) accessing Twitter at all!

let's see what happens next...
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

dj-zath wrote:I'm cirrently talking to the geeks on freenode.net

it seems that Twitter is NOT INTERESTED in anything non-java (or not windows based) accessing Twitter at all!

let's see what happens next...
The entire reason for @anywhere is being _INTERESTED_ in anything using twitter. So not sure where you went on freenode. You want #twitterapi. The help is minimum to join/part'rs, so idle as much as possible to see the true activity of that channel before deciding it's dead and nobody chats.

When you say, megahal script, and it does too much, I assume you mean the twitter, tweet, and megahal script of mine. That was created to allow the bot to participate in the chatter and become a personality. It also was created to "keep" the IRC look and feel. To repurpose it for another use would be hard as it isn't written modularly as it could've been.

Instead, if you look on this forum there already exists an OAuth lib and example written specifically for eggdrop. It is also written modularly and can easily be repurposed. Hopefully this helps. ;)
d
dj-zath
Op
Posts: 134
Joined: Sat Nov 15, 2008 6:49 am
Contact:

Post by dj-zath »

hi there Speechles!

thanks for the reply:


about freenode/#twitterapi:

Thats where I was.. I was involved in some discussion actually.. some of the peeps there didn't like the change either.. while others were "all for it".. I know this sounds "generic" to say.. but I can't recall names at this point.. The discussions about "preventing loss of control from wonky apps" and "tracking of API use/abuse" and "scaleing for ad revenue" were among the top of the debates I whitnessed.

about "megahal":

yeah.. thats what I was referring to- your script adaptations (and that whole project in general) was "way more than I needed"... in terms of what I wanted to do with twitter.. I like the script- and aquired myself a copy from your page.. and had a looksee inside.. very well-organized.. (though I don't understand some parts of it due to the modules in TK) but I was somewhat able to follow along for the most part..

what I came up with (at this point) was to use a direct auth login through curl.. I know it won't work come the 30th.. so I have what 16 days from now to get it figured out..

someone from #Twitterapi gave me something called "twurl" but it appears to be a webpage- not a command-line application (and of course I didn't understand it at all from this point...) so I'm not sure what to do with it in BSD at this point. (looks like it requires Java to be installed) I suspect its meant to be run, exclusively, from a Windows box or other GUI-enabled system with Java, but I haven't actually LOADED it in a windows box to varify this.. not hard to do.. of course.. just gotta be logged in the shell to put it in the website.. and then click on it in Windows and see what happens).. more on that, later...

As I explained in another post.. I'm not really a programmer- just someone who "did what he had to do to get the job done" and its taken me a long long time to scratch-together the code that I have.. :)

again, thanks Mindles for the suggestions and reply... when I'm having one of those "wow I can understand it all" moments, I'll be playing around with stuff some more.. its just lately I've been really "distracted" and tired and unable to understand the simplest of things.. (yeah I'm getting old!)

I hope you are having a great and relaxing day and have a beer (or 2 or even a joint) on me!

-DjZ
:) :)
Last edited by dj-zath on Mon Jul 26, 2010 6:39 am, edited 1 time in total.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Realize, there are two twitter scripts on egghelp:
1) Twitter, Tweets, and MegaHAL
http://forum.egghelp.org/viewtopic.php?t=17556

2) Twitter client with OAuth + Twitter OAuth library
http://forum.egghelp.org/viewtopic.php?t=17780

#1 is written by me. It's written to do specific tasks, and oriented entirely around portraying the content on twitter as though it were an extension of IRC. It includes MegaHAL, but using MegaHAL is not a requirement. It links an unlimited amount of twitter accounts to an unlimited amount of irc channels. It still uses basic auth, but will soon incorporate the OAuth lib from #2 below. This is not a good starting point to use to handle other twitter duties.

#2 is written by horgh and fedex. It is written modular and left lacking on purpose. It works similar, but does not work entirely the same as #1. It links only one twitter account to multiple irc channels. It is a good starting point to use to interface with twitter. It includes OAuth lib and can do exactly what your asking. Why have you not checked this out?
d
dj-zath
Op
Posts: 134
Joined: Sat Nov 15, 2008 6:49 am
Contact:

Post by dj-zath »

Speechles wrote:It is a good starting point to use to interface with twitter. It includes OAuth lib and can do exactly what your asking. Why have you not checked this out?
because I'm an idiot!

actually, I did download the zip package.. but I haven't had a chance to open it up and go through it.. its on my "to do" list :)

thanks for the heads-up in anycase! :)

-DjZ-
:) :)

P.S.

Speaking of me being an idiot...

I have been referring to Speechles as "Mindles".. why? I HAVEN'T A FREAKING CLUE! For this, I'm sorry that I'm such an idiot for not getting the man's name right.. -sigh- sometimes I amaze myself with the shear STUPIDITY I exibit. Again, I'm sorry Speechles.. it was a case of "wrong name syndrone" and I need to stick my head in the sand somewhere... -sigh-
Post Reply