topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday October 14, 2024, 2:40 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: pastebin.com text uploader  (Read 23593 times)

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
DONE: pastebin.com text uploader
« on: March 16, 2006, 03:04 PM »
Hi,

I just thought that it would be helpful to have a little script upload the text you have in the clipbaord to http://pastebin.com/ - it 'just' needs to set the syntax highlighting to "No", paste the text, click the Send button (no need for a name) and retrieve the resulting URL, which it could copy to the clipboard then.

Being able to trigger that all with a hotkey would possibly be the best solution.

Anyone willing/able to do it? :)

« Last Edit: March 17, 2006, 01:47 PM by brotherS »

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #1 on: March 16, 2006, 08:08 PM »
:) This turned out to be a bit more complicated than I had thought, but here's it is!

PasteBinPost - Press Win+S to post your clipboard contents to PasteBin.com and return the URL.

Features:
- Press Win+S to post.
- Option to change the hotkey.



You'll find the downloads and more info at 1 Hour Software by Skrommel.

Skrommel
« Last Edit: April 21, 2006, 07:31 PM by skrommel »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #2 on: March 17, 2006, 05:07 AM »
im about to test this - it woudl be extremely useful.

ps.
skrommel it's not on your 1 hour software page.

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #3 on: March 17, 2006, 06:39 AM »
Wow, thanks a lot! Great work, again! :)

I modified it slightly so it could be added to the main AHK script, and now you could use ESC to close the GUI showing the URL - I'm a keyboard user :D

; https://www.donationcoder.com/forum/index.php?topic=2811.new;topicseen#new
; PasteBinPost.ahk
; Press Win+S to post your clipboard contents to PasteBin.com and return the URL
;Installation:
; Download and install AutoHotkey from http://www.autohotkey.com
; Add this code to your script by right-clicking the tray icon --> Edit This Script
; Then save and --> Reload This Script
; Download WGet.exe from http://users.ugent.be/~bpuype/wget/#download
;Skrommel @2006

;#SingleInstance,Force
;SetBatchLines,-1
;SetFormat,Integer,Hex
;Return

#s::  ;Hotkey Win+S
SetBatchLines,-1
SetFormat,Integer,Hex
TrayTip,PasteBinPost,Posting to PasteBin.com...
in:=Clipboard
out=
Loop,Parse,in
{
  Transform,char,Asc,%A_LoopField%
  StringRight,char,char,2
  out=%out%`%%char%
}
StringReplace,out,out,x,0,All

time:=A_Now
RunWait,WGET.exe --directory-prefix=%time%/ --post-data 'parent_pid=&format=text&code2=%out%&poster=&paste=Send' http://pastebin.com/
Loop,%time%\*.*
  file:=A_LoopFileName
Gui,Add,Edit,,http://pastebin.com/%file%
Gui,Add,Button,GCOPY,&Copy
Gui,Show,,PasteBinPost
TrayTip,
Return

COPY:
Gui,Submit
Clipboard=http://pastebin.com/%file%

GuiEscape:
GuiClose:
FileRemoveDir,%time%,1
Gui, Destroy
Return

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #4 on: March 17, 2006, 11:51 AM »
 :tellme: @mouser: 
it's not on your 1 hour software page
I didn't think it would have general interest...

@brotherS: Watch that SetFormat command, it can disrupt the rest of your script.

Maybe a generic post utility is needed?

But getting the proper post parameters could be a problem... Either the html page must be parsed, or a test post must be intercepted... I used the latter for PasteBinPost, but automating it is a different matter...

Skrommel
« Last Edit: March 17, 2006, 11:56 AM by skrommel »

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #5 on: March 17, 2006, 01:16 PM »
@brotherS: Watch that SetFormat command, it can disrupt the rest of your script.
Oh, could there be a problem? I thought it was save when I read this:

Every newly launched thread (such as a hotkey, custom menu item, or timed subroutine) starts off fresh with the default setting for [SetFormat]

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: DONE: pastebin.com text uploader
« Reply #6 on: March 17, 2006, 03:11 PM »
 :-[ Sorry! I never argue with Chris!

Skrommel

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: DONE: pastebin.com text uploader
« Reply #7 on: April 21, 2006, 07:32 PM »
 :) Finally uploaded a compiled version of PasteBinPost!

Skrommel

CrawlerBrinx

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 17
    • View Profile
    • Donate to Member
Re: DONE: pastebin.com text uploader
« Reply #8 on: October 08, 2012, 03:59 AM »
Should it work out of box or it needs some settings first? It doesn't work for me:
whenever I hit Win+S I get a prompt with the following text:
200 OK
Server: nginx
Date: Mon, 08 Oct 2012 08:57:01 GMT
Content-Type: text/html; charset=utf-8
As far as I understand - instead of this text I should get just an URL, and I don't get it.