Advertisement
illpastethat

Last tweet chromatic

Aug 4th, 2013
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.46 KB | None | 0 0
  1. on $*:text:/^[@!](twitter|tweet)(\s|$)/Si:#: {
  2.   if ($sock(tweet)) .sockclose tweet
  3.   sockopen -e tweet mobile.twitter.com 443
  4.   set %tweet.msg describe $chan
  5.   set %tweet.user $replace($2-,$chr(32),$chr(95))
  6. }
  7. alias tweet {
  8.   if (!$1) { echo -ac info SYNTAX: /tweet USER | halt }
  9.   if ($sock(tweet)) .sockclose tweet
  10.   sockopen -e tweet mobile.twitter.com 443
  11.   set %tweet.msg echo -ac info
  12.   set %tweet.user $replace($1-,$chr(32),$chr(95))
  13. }
  14. on *:sockopen:tweet*:{
  15.   var %x sockwrite -n $sockname
  16.   %x GET $+(/,%tweet.user) HTTP/1.1
  17.   %x Host: mobile.twitter.com
  18.   %x Content-type: application/x-www-form-urlencoded; charset=UTF-
  19.   %x $crlf
  20. }
  21. on *:sockread:tweet*:{
  22.   if ($sockerr) { echo -a SOCKET ERROR: $sockerr | halt }
  23.   else {
  24.     sockread %sockreader
  25.     if (*<div class="tweet-text"* iswm %sockreader) {
  26.       var %d $regsubex(%sockreader,/<a href="([^"]+)"[^>]*?>[^<]+<\/a>/g,\t)
  27.       %tweet.msg $+([,%tweet.user,]) $nohtml(%d)
  28.       unset %sockreader
  29.       unset %tweet.*
  30.       sockclose $sockname
  31.     }
  32.     elseif (*<h1>Sorry, that page doesn’t exist!</h1>* iswm %sockreader) {
  33.       %tweet.msg $+([,%tweet.user,]) User doesn't exist
  34.       unset %sockreader
  35.       unset %tweet.*
  36.       sockclose $sockname
  37.     }
  38.     elseif (*<img alt="This person has protected their tweets* iswm %sockreader) {
  39.       %tweet.msg $+([,%tweet.user,]) User has protected tweets
  40.       unset %sockreader
  41.       unset %tweet.*
  42.       sockclose $sockname
  43.     }
  44.   }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement