• Home
  • Servers
  • Chat
  • Channels
  • Commands
  • Forum
  • FAQ
  • Software
  • Quotes
Topic Options
Rate This Topic
#5219 - 06/17/09 11:09 PM Looking Twitter mIRC Script
Craighton Offline
newbie

Registered: 04/05/09
Posts: 31
Loc: Seattle, Washington
I am looking for a mIRC script to put on my bot. I want it to like look at an RSS feed or my account and when ever I make an tweet it will say that tweet on my channel.

If you can help that would be great. If you have any questions you can find me in #Craighton
_________________________
Tell me and I'll forget, show me and I may remember, involve me and I'll understand.

Top
Sponsored Links
Sponsored Links
Member
*****

Registered: 27/08/04
Posts: 10136
Loc: Mountain View, CA
Top
#5253 - 06/22/09 12:43 AM Re: Looking Twitter mIRC Script [Re: Craighton]
FordLawnmower Offline
Over 100 posts

Registered: 02/15/09
Posts: 111
Loc: Ohio
Hello Craighton, I just noticed this. That's a pretty simple script to make. I'll take a look at it tomorrow when I get home from work and see what I can put together.
_________________________
If you already know everything, You can never learn anything :P

Top
#5258 - 06/22/09 11:14 AM Re: Looking Twitter mIRC Script [Re: FordLawnmower]
Freekie Offline
Over 100 posts

Registered: 08/01/06
Posts: 143
Loc: NE Wisconsin
_________________________
Server Admin - Neptune
Global IRC Operator and Services Operator on Cylon, Odyssey, and Rubicon.

Top
#5264 - 06/22/09 10:16 PM Re: Looking Twitter mIRC Script [Re: Freekie]
FordLawnmower Offline
Over 100 posts

Registered: 02/15/09
Posts: 111
Loc: Ohio
Freekie, I have one posted on this site --->> http://www.wyldryde.org/forum/ubbthreads...y.html#Post4600

If you just want a broadbased general rss feed reader for mirc.

A twitter specific one is a very good idea though. With the growing popularity of twitter and also because of the fact that the description section of the twitter feed will always be 140 chars or less.

Anyway, I made one. just finishing some final testing. I will post it on WyldRyde and only on WyldRyde, In about 5 minutes.
_________________________
If you already know everything, You can never learn anything :P

Top
#5265 - 06/22/09 11:02 PM Re: Looking Twitter mIRC Script [Re: FordLawnmower]
FordLawnmower Offline
Over 100 posts

Registered: 02/15/09
Posts: 111
Loc: Ohio


Hope this is what you were looking for Craighton.

To use it, just paste it into a new remote and save it with a unique filename.

After it is loaded, just right click the channel you want to add the feed to and click twitfeed.

Click Add on the dialog and fill in all of the boxes.

Feed Name is the name you want displayed when your twitter updates are posted. Feed Name can include color codes, but it must be unique to this channel. You cannot have two feed names that are the same for a given channel.

Feed Link is the full address of the twitter RSS Page. This must be a valid page, so check it with your browser before adding it.

Delay in seconds is the amount of time you want the script to wait before checking the page for updates. The minimum is 60. I suggest using something more like 300.

This RSS script is made just for twitter. It may do other pages but it's not designed to handle multiple page formats.

Any Problems, please post them here.
I didn't test this for as long as I normally would with a script like this, so let me know if you find any bugs and I will fix them asap.


Code:
alias -l TwitFeed {
  var %sockname $+(TwitFeed,$1,$ticks), %site $gettok($2,2,47)
  sockopen %sockname %site 80
  sockmark %sockname $remove($2,%site,http://) 0 $1 %site
}
On *:Sockopen:TwitFeed*: {
  sockwrite -nt $sockname GET $gettok($sock($sockname).mark,1,32) HTTP/1.1
  sockwrite -n $sockname Host: $gettok($sock($sockname).mark,4,32)
  sockwrite -n $sockname $crlf
}
On *:Sockread:TwitFeed*: {
  if ($sockerr) { echo -at >Sock error TwitFeed< }
  else {
    var %TwitFeed | sockread %TwitFeed
    if (<item> isin %TwitFeed) { sockmark $sockname $puttok($sock($sockname).mark,$calc($gettok($sock($sockname).mark,2,32) + 1),2,32) }
    if ($gettok($sock($sockname).mark,2,32) >= 5) { TwitResults $gettok($sock($sockname).mark,3,32) | sockclose $sockname | return }
    if ($gettok($sock($sockname).mark,2,32)) {
      if ($between(%TwitFeed,<description>,</description>,1)) { 
        hadd -m TwitFeed $+($gettok($sock($sockname).mark,3,32),$gettok($sock($sockname).mark,2,32)) $ifmatch
      }
      if ($between(%TwitFeed,<pubdate>,+,1)) || ($between(%TwitFeed,<pubdate>,-,1)) {
        hadd -m TwitFeed $+($gettok($sock($sockname).mark,3,32),$gettok($sock($sockname).mark,2,32)) $&
          $hget(TwitFeed,$+($gettok($sock($sockname).mark,3,32),$gettok($sock($sockname).mark,2,32))) $ifmatch
      }      
      if ($between(%TwitFeed,<link>,</link>,1)) {
        hadd -m TwitFeed $+($gettok($sock($sockname).mark,3,32),$gettok($sock($sockname).mark,2,32)) $&
          $hget(TwitFeed,$+($gettok($sock($sockname).mark,3,32),$gettok($sock($sockname).mark,2,32))) $+(,$ifmatch)
      }
    }
  }
}
dialog -l TwitFeed {
  title "TwitFeed"
  size -1 -1 104 120
  option dbu
  text "Network:", 1, 8 6 25 8
  text "Channel:", 2, 8 18 25 8
  text "", 3, 36 6 65 8
  text "", 4, 36 18 65 8
  text "FEEDS", 5, 8 28 89 8
  list 6, 8 37 89 60, size vsbar
  button "Add", 7, 5 106 29 12
  button "Delete", 8, 38 106 29 12
  button "Edit", 9, 71 106 29 12
  text "", 10, 0 97 105 8
}
On *:Dialog:TwitFeed*:init:*: {
  did -a $dname 3 $network
  did -a $dname 4 $active
  var %count $hfind(TwitFeedLIST,$+($network,,$active,*),0,w).item
  while (%count) {
    did -a $dname 6 $gettok($hfind(TwitFeedLIST,$+($network,,$active,*),%count,w).item,3,7)
    dec %count
  }
}
On *:Dialog:TwitFeed*:Sclick:7-9: {
  if ($did == 7) { dialogopen $+(TwitEdit,,$did($dname,3).text,,$did($dname,4).text) TwitEdit | if ($dialog($dname)) { dialog -x $dname } }
  if ($did == 8) && ($did($dname,6).seltext) {
    var %removeme $+($did($dname,3).text,,$did($dname,4).text,,$did($dname,6).seltext)
    .timer $+ %removeme off
    hdel TwitFeedLIST %removeme
    did -df $dname 6 $did($dname,6).sel
  }
  if ($did == 9) && ($did($dname,6).seltext) { 
    dialogopen $+(TwitEdit,,$did($dname,3).text,,$did($dname,4).text,,$did($dname,6).seltext) TwitEdit
    if ($dialog($dname)) { dialog -x $dname }
  }
}
dialog -l TwitEdit {
  title "TwitFeed Add/Edit"
  size -1 -1 104 112
  option dbu
  text "Network:", 1, 8 6 25 8
  text "Channel:", 2, 8 18 25 8
  text "", 3, 36 6 65 8
  text "", 4, 36 18 65 8
  text "FEED NAME", 5, 8 28 89 8
  text "", 10, 0 86 105 8, center
  text "FEED LINK", 6, 8 52 89 8
  edit "", 7, 7 38 90 10, autohs
  edit "", 8, 7 62 90 10, autohs
  button "Cancel", 9, 66 96 29 12
  button "Accept", 11, 8 96 29 12
  text "Delay in Seconds:", 12, 8 77 43 8
  edit "", 13, 54 76 43 10
}
On *:dialog:TwitEdit*:Sclick:9,11: {
  if ($did == 11) {
    if ($did($dname,7).text) && ($did($dname,8).text) && ($did($dname,13).text) {
      if (http:// !isin $did($dname,8).text) {
        did -a $dname 10 Link missing prefix http://
        did -f $dname 8
        .timer 1 4 if ($!dialog($dname)) { did -a $dname 10 }
        return
      }
      if ($did($dname,13).text !isnum) {
        did -a $dname 10 Delay should be a NUMBER
        did -f $dname 13
        .timer 1 4 if ($!dialog($dname)) { did -a $dname 10 }
        return
      }
      var %addit $+($did($dname,3).text,,$did($dname,4).text,,$spunder($did($dname,7).text)), %del $did($dname,13).text, %flink $did($dname,8).text
      TwitTimer %addit %flink %del
      hadd -m TwitfeedLIST %addit %addit %flink %del
      var %diagname $+(TwitFeed,,$did($dname,3).text,,$did($dname,4).text)
      if ($dialog(%diagname)) { did -a %diagname 6 $spunder($did($dname,7).text) }
      dialogopen %diagname TwitFeed
      if ($dialog($dname)) { dialog -x $dname }
    }
    else {
      did -a $dname 10 Please fill in all of the boxes
      .timer 1 4 if ($!dialog($dname)) { did -a $dname 10 }
    }
  }
  if ($did == 9) {
    var %diagname $+(TwitFeed,,$did($dname,3).text,,$did($dname,4).text)
    dialogopen %diagname TwitFeed
    if ($dialog($dname)) { dialog -x $dname }
  }
}
On *:dialog:TwitEdit*:init:*: {
  tokenize 7 $dname
  did -a $dname 3 $2
  did -a $dname 4 $3
  if ($4) {
    did -am $dname 7 $4
    did -af $dname 8 $gettok($hget(TwitFeedLIST,$remove($dname,TwitEdit)),2,32)
    did -a $dname 13 $gettok($hget(TwitFeedLIST,$remove($dname,TwitEdit)),3,32)
  }
}
On *:Connect: {
  if (!$hget(TwitFeedLIST)) {
    hmake TwitFeedLIST 5
    if ($exists(TwitFeedLIST.hsh)) { hload TwitFeedLIST TwitFeedLIST.hsh }
  }
  var %records $hget(TwitFeedLIST,0).item
  while (%records) {
    .timer 1 $calc(%records * 5) TwitTimer $hget(TwitFeedLIST,%records).data
    dec %records
  }
}
On *:Disconnect: {
  if ($hget(TwitFeedLIST)) { 
    hsave TwitFeedLIST TwitFeedLIST.hsh
  }
}
On *:Exit: { hfree TwitFeedLIST }
On *:Unload: { hfree TwitFeedLIST }
menu channel {
  TwitFeed:dialogopen $+(Twitfeed,,$network,,$chan) twitfeed
}
alias -l TwitResults {
  var %count 4
  while (%count) {
    if (!$hfind($+(twitfeedDONE,$1),$+(*,$right($hget(TwitFeed,$+($1,%count)),10),*),1,w).data) { 
      if ($me ison $gettok($1,2,7)) { .msg $gettok($1,2,7) 14T07wit14F06eed $gettok($1,3,7) $replace($hget(TwitFeed,$+($1,%count)),&quot;,",&#8217;,',&#8221;,") }
    }
    dec %count
  }
  while (%count <= 3) {
    inc %count
    hadd -m $+(TwitFeedDONE,$1) $+($1,%count) $hget(TwitFeed,$+($1,%count))
  }
}
;Syntax TwitTimer NetworkChannelFeedName http://full/link/to/feedpage/4325677 delayinseconds
alias -l TwitTimer {
  TwitFeed $1 $2
  .timer $+ $1 1 $iif($3 > 60,$3,60) TwitTimer $1-
}
alias -l DialogOpen { dialog $iif($dialog($1),-v,-m) $1- }
alias -l spunder { return $replace($1-,$chr(32),_) }
;alias by Gummo
alias -l between { noop $regex($1,/\Q $+ $2 $+ \E(.*?)\Q $+ $3 $+ \E/gi) | return $regml($4) }
_________________________
If you already know everything, You can never learn anything :P

Top
#5274 - 06/23/09 08:27 PM Re: Looking Twitter mIRC Script [Re: FordLawnmower]
FordLawnmower Offline
Over 100 posts

Registered: 02/15/09
Posts: 111
Loc: Ohio
I found a bug in this script. It's only posting to the active network, so if you are on multiple networks, it's not going to work right.

I made a few changes and I'm testing them right now. I'll put the fixed version on a new post and add the link here in a couple hours.
_________________________
If you already know everything, You can never learn anything :P

Top
#5276 - 06/23/09 10:24 PM Re: Looking Twitter mIRC Script [Re: FordLawnmower]
FordLawnmower Offline
Over 100 posts

Registered: 02/15/09
Posts: 111
Loc: Ohio
_________________________
If you already know everything, You can never learn anything :P

Top


Moderator:  Jeff, mandy, usrbingeek