topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday December 12, 2024, 3:42 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Xchat script for tircd (Twitter)  (Read 5791 times)

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
IDEA: Xchat script for tircd (Twitter)
« on: March 08, 2009, 09:21 PM »
I am running tircd (an ircd proxy for the twitter API) so I can use xchat as my twitter client.

tircd allows me to group people that I follow, by creating a new channel (just /join), and then just /invite who I want in it.

It also allows me to perform searches by /join #whatever followed by /topic [searchterm]
or /join #hashtag  followed by /topic #hashtag #hashtag

I need an xchat script that will automate all of this for me and

  • autojoin a specified list of channels on my tircd
  • change the topics on those channels (each will be different)
  • invite a specified list of users to some of those channels.


Something like this:

/join #example1
/topic example1

/join #example2
/topic #example2 #example2

/join #example3
/invite person1 person2 person3


This has to work only with the tircd and not interfere with any real irc networks & channels I may also be connected to.

This can be in either perl or ruby, because my python plugin doesn't work with the version of python that I have installed on my machine. (it's for 2.4 and I have 2.6) And I am not sure why I can't get tcl to work.

I also need another script that will automatically convert any & all links I post on just the tircd channels to tinyurl links. I do not want to have to use a /tinyurl command. It must work on links that appear anywhere in a message I post. It also must not affect any other channels on any other network. I don't want to automatically send tinyurl links everywhere, just to twitter.

I don't know the first thing about xchat scripting, nor do I know perl or ruby...otherwise I would try to do this myself.

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: IDEA: Xchat script for tircd (Twitter)
« Reply #1 on: March 09, 2009, 05:58 PM »
You can tell xchat which channels to join: Press Ctrl+S to open the server list, there click on "Add" and a "New Network" will be added to the list. Change its name to something more appropriate, like "twitter", and click on "Edit". Here you specify the server for this network, it is probably "localhost" (if the port differs from 6667 append it to the hostname with a slash: "localhost/8889")

Now there is a bunch of checkboxes, of which the one about automatically might be the most interesting. Below that, we see a list of text boxes, one is named "Favorite Channels". This is where you keep your list of channels you want to join. However, I recommend using the helper dialog that pops up when you click a third button, the one with the "..." right of the text box.

And without scripting we can go only this far.

If the list of people and channels does not change often, you could use something I call "simple scripts" which are a list of xchat commands that are executed by xchat. But if you want more comfort and features, we need a real script...

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: IDEA: Xchat script for tircd (Twitter)
« Reply #2 on: March 09, 2009, 06:05 PM »
You can tell xchat which channels to join: Press Ctrl+S to open the server list, there click on "Add" and a "New Network" will be added to the list. Change its name to something more appropriate, like "twitter", and click on "Edit". Here you specify the server for this network, it is probably "localhost" (if the port differs from 6667 append it to the hostname with a slash: "localhost/8889")

Now there is a bunch of checkboxes, of which the one about automatically might be the most interesting. Below that, we see a list of text boxes, one is named "Favorite Channels". This is where you keep your list of channels you want to join. However, I recommend using the helper dialog that pops up when you click a third button, the one with the "..." right of the text box.

And without scripting we can go only this far.

I know I could do that, but I am not sure how many search & grouping channels I may want to create. It could be a lot. I don't want to have issues with overloading that little box.


If the list of people and channels does not change often, you could use something I call "simple scripts" which are a list of xchat commands that are executed by xchat. But if you want more comfort and features, we need a real script...

Can you tell me more about what you mean by "simple scripts"?

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: IDEA: Xchat script for tircd (Twitter)
« Reply #3 on: March 09, 2009, 06:37 PM »
It could be something like this
/join #this
/invite him
/invite her
/join #that
/invite them
/invite those

Just xchat commands, one on each line. You can't use variables, loops, or any sort of control structure here, it's just a list of commands which will be executed in that order.

Put these in a text file and use "load -e c:\Wherever\You Put\The script.txt" as connection command.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: IDEA: Xchat script for tircd (Twitter)
« Reply #4 on: March 09, 2009, 07:48 PM »
That will work great!

Really, thank you so much.

I had no idea you could do that.

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: IDEA: Xchat script for tircd (Twitter)
« Reply #5 on: March 10, 2009, 12:16 PM »
if you need a delay after a command it gets tricky with this sort of simple script. suppose you want to wait for 2 seconds after joining a channel before you start inviting others:
/join #channel
/timer -repeat 1 2 invite person1
/invite person2

this contradicts my statement about missing loops and shows how far you have to go to get a simple sleep: This "timer" only runs once (-repeat 1) with a delay of 2 seconds and executes "invite person1" on every loop.

When you need anything more sophisticated than this you will need a proper programming language :)

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: IDEA: Xchat script for tircd (Twitter)
« Reply #6 on: March 10, 2009, 10:15 PM »
Just to tell you how it all worked out...

Finished my "simple script" and restarted xchat.

Got about halfway through the list and tircd crashed. (was a lot of commands to group over 300 people by their interests)

Restarted the server and it worked beautifully, though.

But I may end up running a second copy of xchat as a dedicated twitter client.

I am thinking about writing a full tutorial on how to set it all up.

Many thanks for your help.  :Thmbsup: