I've managed to get a proof of concept together that works with strawpoll.
The methodology to do so is as such:
Get / from
http://strawpoll.me Wait for all headers to be recieved
Digest headers, looking for the set cookie headers
Store the cookies
Once you have the cookies
Make a post to /api/v2/polls on strawpoll.me
Send Cookie header with request
Wait for all headers to be recieved
If you recieve HTTP/1.1 201 Created response
parse body to get link id
if not, you did something wrong
And the proof of concept: /strawpoll
alias strawpoll {
sockopen strawpoll-start strawpoll.me 80
}
alias -l err {
echo -a 04[StrawPoll]: $1-
}
alias -l out {
echo -a 03[StrawPoll]: $1-
}
on *:SOCKOPEN:strawpoll-start:{
if ($sockerr) {
err SockOpen Error
}
else {
out SockOpen
var %s = sockwrite $sockname
%s GET / HTTP/1.1 $+ $crlf
%s Host: strawpoll.me $+ $crlf
%s $crlf
}
}
on *:SOCKWRITE:strawpoll-start:{
if ($sockerr) {
err SockWrite Error
}
else {
out SockWrite
}
}
on *:SOCKREAD:strawpoll-start:{
if ($sockerr) {
err SockRead Error
}
else {
var %tmp
sockread %tmp
if ($regex(%tmp, /^Set-Cookie: ([^ ;]+)/i)) {
strawpoll2 $regml(1)
sockclose $sockname
}
}
}
on *:SOCKCLOSE:strawpoll-start:{
if ($sockerr) {
err SockClose Error
}
else {
out SockClose
}
}
;---------------------
alias strawpoll2 {
sockopen strawpoll-post strawpoll.me 80
sockmark strawpoll-post $1-
}
on *:SOCKOPEN:strawpoll-post:{
if ($sockerr) {
err POST -> SockOpen Error
}
else {
out POST -> SockOpen
var %p {"options": ["aa1", "bb2", "cc3", "dd4"], "title": "mytest from mIRC", "permissive": true, "multi": true}
var %s = sockwrite $sockname
%s POST /api/v2/polls HTTP/1.1 $+ $crlf
%s Host: strawpoll.me $+ $crlf
%s User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36 $+ $crlf
%s Accept: application/json, text/plain, */* $+ $crlf
%s Accept-Language: en-US,en;q=0.8 $+ $crlf
%s Connection: keep-alive $+ $crlf
%s Cookie: $sock($sockname).mark $+ $crlf
%s Origin: http://strawpoll.me $+ $crlf
%s Referer: http://strawpoll.me/ $+ $crlf
%s Content-Type: application/json; charset=UTF-8 $+ $crlf
%s Content-Length: $len(%p) $+ $crlf
%s $crlf
%s {"options": ["aa1", "bb2", "cc3", "dd4"], "title": "mytest from mIRC", "permissive": true, "multi": true}
}
}
on *:SOCKWRITE:strawpoll-post:{
if ($sockerr) {
err POST -> SockWrite Error
}
else {
out POST -> SockWrite
}
}
on *:SOCKREAD:strawpoll-post:{
if ($sockerr) {
err POST -> SockOpen Error
}
else {
var %tmp
sockread %tmp
out POST -> %tmp
}
}
on *:SOCKCLOSE:strawpoll-post:{
if ($sockerr) {
err POST -> SockClose Error
}
else {
out POST -> SockClose
}
}
alias -l sockwrite {
echo -a 13[SockWrite]: $1 $replace($2-,$cr,\r,$lf,\n)
!sockwrite -a $1-
}
If requested enough, I could write a script to manage options, title, etc and perform the post