Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • September 01, 2015, 09:12:19 AM
  • Proudly celebrating 10 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 15302 times)

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,122
    • View Profile
    • Donate to Member
DONE: pastebin.com text uploader
« on: March 16, 2006, 03:04:24 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:47 PM by brotherS »

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #1 on: March 16, 2006, 08:08:44 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
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
« Last Edit: April 21, 2006, 07:31:16 PM by skrommel »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,968
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #2 on: March 17, 2006, 05:07:35 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,122
    • View Profile
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #3 on: March 17, 2006, 06:39:24 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

Code: [Select]
; http://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: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #4 on: March 17, 2006, 11:51:20 AM »
 :tellme: @mouser: 
Quote
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
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
« Last Edit: March 17, 2006, 11:56:02 AM by skrommel »

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,122
    • View Profile
    • Donate to Member
Re: IDEA: pastebin.com text uploader
« Reply #5 on: March 17, 2006, 01:16:21 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:

Quote
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: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: DONE: pastebin.com text uploader
« Reply #6 on: March 17, 2006, 03:11:03 PM »
 :-[ Sorry! I never argue with Chris!

Skrommel
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

skrommel

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

Skrommel
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

CrawlerBrinx

  • Participant
  • Joined in 2012
  • *
  • gravatar avatar
  • Posts: 17
    • View Profile
    • Donate to Member
Re: DONE: pastebin.com text uploader
« Reply #8 on: October 08, 2012, 03:59:49 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:
Code: [Select]
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.