ShowHN: GetURL - A CLI tool to get a public link for any file
Something I threw together over the weekend. I've been using filepicker on a website of mine. Realized that I could hack it to upload and share files in a simple tool.
Inspired by cloudApp, when I found myself wanting a command line version.
Seems like this could be done with more respect for user/data sovereignty if done with Node.js. Essentially, you'd cat the file into the script, it would spin up an HTTP server, do some port knocking or whatever NAT-traversal-fu is necessary, then spit out a link with either your raw IP, or a preconfigured dynDNS domain name.
This way we aren't carelessly littering our data all over the "cloud".
Another:
cat file | curl -F 'sprunge=<-' sprunge.usNice work and very handy.
I hadn't come across filepicker.io before and reading through the geturl code something jumped out at me:
APIKEY = check_output(['curl', '--silent', "%(fpurl)s/getKey?email=%(email)s" % {'fpurl': FPAPIURL, 'email': email}])
From that, it looks like any random person can fill up your filepicker.io space providing they have your API key or know the email address you used to register the account with. Made sense when I read a bit more about what filepicker.io actually does (i.e. a client-side embeddable javascript file uploader) but it's something to be aware of (especially if you link your account up to an S3 backend!).
Neat, +1 on the 'brew' addition intent :)
I have no idea why I haven't installed xsel already. The help mentions a secondary clipboard. X has a secondary clipboard? Is there a way to paste that (like middle click for the primary)?
Since I have web hosting and use GitHub, here's my method:
Elaborate, sure, but it does the job. update.sh runs git push and then does an SSH into my server and a git pull. (Because I'm too lazy to actually set up git on my own server)cp file_name ~/Projects/2012/ajf.me/ajf.me/imagedump/ && cd ~/Projects/2012/ajf.me/ajf.me/ && git add imagedump && git commit -m 'new file' && cd .. && ./update.shThis is awesome, it actually makes filepicker.io useful for me. My main use-case for Dropbox has turned out to be for this kind of sharing... geturl is waaaaaay easier.
This a nice nifty script. Thanks!
Something I noticed (https://www.filepicker.io/pricing/): Since filepicker.io charges by number of files and NOT by total size of files, a free account could potentially host a huge amount of data.
Eg: 5000 files, each of 1 GB = 5 TB!!!
It couldn't handle files with spaces, plus the link it gives initiates a download for the file instead allowing you to view it in the browser. Considering most of the time I want to quickly upload a file in this manner the file is a screenshot, this is basically useless for me.
Very nice! But no Python 2.6 support?
What about storage usage?
> To make it easier to get started, if you haven't > put in your S3 credentials we will store them on > our servers, but as your usage increases we will > ask you to move to your own storage.Nice tool, I made something similar for dropbox a while back that symlinks/copies files into your DB folder.
Nice! There's an opportunity for some company sponsor this (a la localtunnel.com and twilio).
Inspired by geturl, I built this: http://news.ycombinator.com/item?id=4626779
pro: no storage backend needed con: works only behind a UPnP router (most are ok)
I really liked it, so I ported it to perl implementing a basic caching system (SHA1), I hope you don't mind: https://github.com/psychotropic/Get--Url/
I still prefer Dropbox because you have better control about what you upload.
Simply copy your files into ~/Dropbox/Public, right-click and choose Dropbox > Copy Public URL. Voilà !
Very awesome tool, it's a great way of sharing nice and quickly!
Nice utility!
Just a note:
28: exit("`curl` is requrired. Please install it")
very cool and very efficient