Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on $*:text:/^[@!](twitter|tweet)(\s|$)/Si:#: {
- if ($sock(tweet)) .sockclose tweet
- sockopen -e tweet mobile.twitter.com 443
- set %tweet.msg describe $chan
- set %tweet.user $replace($2-,$chr(32),$chr(95))
- }
- alias tweet {
- if (!$1) { echo -ac info SYNTAX: /tweet USER | halt }
- if ($sock(tweet)) .sockclose tweet
- sockopen -e tweet mobile.twitter.com 443
- set %tweet.msg echo -ac info
- set %tweet.user $replace($1-,$chr(32),$chr(95))
- }
- on *:sockopen:tweet*:{
- var %x sockwrite -n $sockname
- %x GET $+(/,%tweet.user) HTTP/1.1
- %x Host: mobile.twitter.com
- %x Content-type: application/x-www-form-urlencoded; charset=UTF-
- %x $crlf
- }
- on *:sockread:tweet*:{
- if ($sockerr) { echo -a SOCKET ERROR: $sockerr | halt }
- else {
- sockread %sockreader
- if (*<div class="tweet-text"* iswm %sockreader) {
- var %d $regsubex(%sockreader,/<a href="([^"]+)"[^>]*?>[^<]+<\/a>/g,\t)
- %tweet.msg $+([,%tweet.user,]) $nohtml(%d)
- unset %sockreader
- unset %tweet.*
- sockclose $sockname
- }
- elseif (*<h1>Sorry, that page doesn’t exist!</h1>* iswm %sockreader) {
- %tweet.msg $+([,%tweet.user,]) User doesn't exist
- unset %sockreader
- unset %tweet.*
- sockclose $sockname
- }
- elseif (*<img alt="This person has protected their tweets* iswm %sockreader) {
- %tweet.msg $+([,%tweet.user,]) User has protected tweets
- unset %sockreader
- unset %tweet.*
- sockclose $sockname
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement