Grouphug.us poster

By kerstt on Jun 08, 2007

this script posts in the editbox on grouphug.us
big thanks to douchebag <3 and to quickstep for writing a great guide!

alias -l htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&,$chr(9))
  return %x
}
alias urlencode {
  var %a = $regsubex($$1,/([^\w\s])/Sg,$+(%,$base($asc(\t),10,16,2)))
  return $replace(%a,$chr(32),$chr(43))
}
dialog grouphug {
  title "Grouphug.us poster"
  size -1 -1 184 155
  option dbu
  edit "The post:", 1, 11 37 162 107, multi
  button "Submit", 2, 12 10 37 12
  button "Clear", 3, 68 10 37 12
  button "Go to grouphug.us", 4, 116 10 53 12
}
on *:dialog:grouphug:sclick:3: did -r $dname 1
on *:dialog:grouphug:sclick:4: run http://grouphug.us/
on *:dialog:grouphug:sclick:2: sockopen grouphug.us grouphug.us 80
on *:sockopen:grouphug.us:{
  var %post = confession_text= $+ $urlencode($did(grouphug,1))
  sockwrite -nt $sockname POST / HTTP/1.1
  sockwrite -nt $sockname Host: grouphug.us
  sockwrite -nt $sockname Content-Length: $len(%post)
  sockwrite -nt $sockname Content-Type: application/x-www-form-urlencoded
  sockwrite -nt $sockname $crlf %post
}
on *:sockread:grouphug.us:{
  if ($sockerr) did -ra grouphug 1 socket error $sockerr
}
alias grouphug dialog -m grouphug grouphug

Comments

Sign in to comment.
kerstt   -  Jun 08, 2007

wont shorten cause i do them all in 1 line. nub <3
with $did its 4 lines with me its 3 lines

 Respond  
F*U*R*B*Y*   -  Jun 08, 2007

shorten your sclicks

on *:DIALOG:grouphug:sclick:*: {
  if ($did == 3) { did -r $dname 1 }
  elseif ($did == 4) { run http://grouphug.us/ }
  elseif ($did == 2) { sockopen grouphug.us grouphug.us 80 }
}

:P

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.