mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2010
Posts: 89
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
I've made a script which automatically grabs text from the website pastie.org and puts it into a file. Next I want to be able to automatically paste text onto the website pastie.org and get the url it would generate when you click 'create paste', preferably with private ticked.

How would I get my text into the box, tick the private button, and paste it onto the website and get the URL of it. Is it even possible?

It kind of seems way to hard to be possible, much harder than simply getting text from the website thats for sure.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Usage:
/pastie.get http://pastie.org/8917847 [filename]
/pastie.post <text|filename|&binvar>

I have not implemented fetching the authorization and cookies yet, so this version will probably break when the authorization expires. I will add that functionality later, as I'm not sure if it even matters.

http://pastie.org/pastes/8917847/text

Joined: Dec 2010
Posts: 89
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
Hey loki, thanks so much! The pastie.post works perfectly. And thanks also for the pastie.get, although the only thing I'm having trouble with is that it's putting all the text onto one line, I wanted it to be exactly like the pastie page, where each line has its own line in the file. Most things I will be pasting on there is scripts, so ofc if it all comes out as one big long line thats going to be a problem xD How would i fix this smile?

And again, thanks so much for writing me this code, its amazing! laugh

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Their server is replacing the original line endings with unix style ($lf) line endings, this is really only a problem if viewing the file in notepad. mIRC and most other programs will handle it just fine.

This version will convert line endings to Windows style ($crlf): http://pastie.org/pastes/8918947/text

Joined: Dec 2010
Posts: 89
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2010
Posts: 89
Thanks again! perfect! laugh


Link Copied to Clipboard