Comments (27)
Just adding a comment to this old question:
You can send the stdout of something to hastebin like this:
somecommand | curl --data-binary@- https://hastebin.com/documents
That will return a JSON repsonse that looks something like:
{"key":"oxekofidik"}
And you can turn that into a URL by appending the value to https://hastebin.com
. That is, the URL for this example would be https://hastebin.com/oxekofidik. This is an unfortunate api, because it makes hastebin difficult to use from the command line with some code to handle extracting the key from the response and generate a URL.
A simple shell script that handles this might look like:
#!/bin/bash
result=$(curl -sf --data-binary @${1:--} https://hastebin.com/documents) || {
echo "ERROR: failed to post document" >&2
exit 1
}
key=$(jq -r .key <<< $result)
echo "https://hastebin.com/${key}"
Assuming the script is named hastebin
, running it looks like:
$ echo look ma no hands | hastebin
https://hastebin.com/lubiveyuni
Or:
$ hastebin README.md
https://hastebin.com/carateheki
It would be useful if hastebin were to implement support for the http PUT
method at this endpoint, and then return a URL. This would allow convenient use of curl's -T
command line option without any additional wrapper. Posting a file would look like:
curl -Tmyfile https://hastebin.com/documents
And posting stdin would look like:
curl -T- https://hastebin.com/documents
It would also make sense to implement the api on /
instead of /documents
, because this would reduce the amount of typing by 25%. Support posting over plain http://
and you could just write:
curl -T- hastebin.com
Which would be awesome, and is short enough that it doesn't really make sense to write a dedicated client anymore. In fact, chunk.io does exactly this, and it is super convenient.
from haste-server.
Sorry, not sure I understand
from haste-server.
How would I want to post a paste without actually going on the website. Something like..
example.com:7777/?data=[the paste]
from haste-server.
curl -XPOST http://hastebin.com/documents -d'like this'
or you should also check out haste-client, a more user-friendly tool:
https://github.com/seejohnrun/haste-client
from haste-server.
Is there a way to do this with like, ShareX?
http://code.google.com/p/sharex/
from haste-server.
No one has built a windows file helper like that yet, but I'm sure it's possible
You can create a paste from any computer with an internet connection
This only works on command line, but is a good resource to check out:
https://github.com/ajryan/WinHaste
from haste-server.
Also if someone ends up creating something like this, I'd be glad to check it over and link from the README
from haste-server.
Sorry if this sounds dumb, but sharex requires an "argument" and the value.
The value is %input since its what the clipboard contains however the argument needs to be a field like thing for hastebin.com that basically writes to a hastebin.
This is what it looks like with a random "name argument"
http://hastebin.com/riqemuciwu
My current settings: http://i.imgur.com/xF2zHjf.png
Sorry if this question is dumb :/ I'm not very into HTTP and webdev.
from haste-server.
Heya - not dumb.
Hastebin doesn't currently support form-data request bodies.
Does ShareX provide a way to have a non-form-data body (just flat text)?
That's what you'd be looking for - if not we can probably re-open this ticket and get this feature in
from haste-server.
Unfortunately not that I know of :/
Thanks tho! Also hastebin is awesome <3
from haste-server.
Thanks - I'll see what I can get together
from haste-server.
Thanks mate!
from haste-server.
Just wondering if you have an ETA ish for this? <3
from haste-server.
Most likely this weekend
On Fri, Feb 7, 2014 at 8:59 AM, Amir Omidi [email protected] wrote:
Just wondering if you have an ETA ish for this? <3
Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-34438296
.
from haste-server.
Uh just a bump xD
from haste-server.
Bump
from haste-server.
all set @aaomidi - and i'll be deploying this to hastebin.com later today
from haste-server.
@seejohnrun any api doc on this POST impl?
from haste-server.
Some basic details can be seen here - hope it helps:
https://github.com/seejohnrun/haste-server/wiki/POST-api
from haste-server.
Getting a 500 Internal Server Error with message Error adding document
when using:
{"url":"http://hastebin.com/documents","headers":{"User-Agent":"atom-rest-client","Content-Type":"text/plain; charset=utf-8"},"method":"POST","body":"some text"}
very simple request, using that api.. not working :(
from haste-server.
works for me:
curl -XPOST 'http://hastebin.com/documents' -d'hello world'
What tool are you using?
from haste-server.
can you give some more detail on this - these requests are working for me
using very simple curl
On Fri, Sep 12, 2014 at 10:46 AM, Amir Omidi [email protected]
wrote:
Okay so apparently you need to load it on the RAW output first, then it
loads on the normal website too?—
Reply to this email directly or view it on GitHub
#54 (comment)
.
from haste-server.
It's been working for me. works for my atom package. https://github.com/ddavison/kinetic
from haste-server.
Thanks for the update @ddavison - and glad it's working!
from haste-server.
Could someone give me an example of how to do this using a form and submitting with PHP?
from haste-server.
I'm trying
curl -XPOST 'http://hastebin.com/documents' -d'hello world'
in macOS, but it returns nothing. It should output the json string to stdout?
from haste-server.
from haste-server.
Related Issues (20)
- healthcheck in docker file need a shell HOT 2
- [QUESTION] what exactly is STORAGE_EXPIRE_SECONDS? HOT 2
- Add Font Awesome icons instead of the image thing. HOT 2
- Reopen request HOT 1
- Hastebin IPFS Support HOT 2
- Disable automatic closing of issues HOT 1
- self-hosted instace, buttons greyed out
- nginx config need help please HOT 1
- alpine image HOT 2
- Tried to host haste-server on a Plesk webspace, error occured HOT 2
- 503 error while post in /documents HOT 2
- daemonize haste-server HOT 3
- Important announcement: Soon a new version of Hastebin will be launched! HOT 15
- bun
- Haste server sends 413 for requests over 1mb
- Release containers in a public repo HOT 5
- Authentication failed (MongoDB) HOT 2
- pastebin HOT 1
- 1. Remove deprecation warning from existing trading-api hybrid websocket endpoint. HOT 3
- this lost almost all of the reasons why it was any good in the refactor. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haste-server.