Compare commits

...

2 Commits

Author SHA1 Message Date
Ceda EI a541630848 Add /:id/raw 2019-07-17 16:38:13 +05:30
Ceda EI e067323714 Change about.md 2019-07-17 16:30:37 +05:30
2 changed files with 16 additions and 37 deletions

View File

@ -15,38 +15,13 @@ To make a new entry, click "New" (or type 'control + n')
## From the Console
Most of the time I want to show you some text, it's coming from my current
console session. We should make it really easy to take code from the console
and send it to people.
[bin-client](git.webionite.com/ceda_ei/bin-client)
`cat something | haste` # https://hastebin.com/1238193
You can even take this a step further, and cut out the last step of copying the
URL with:
* osx: `cat something | haste | pbcopy`
* linux: `cat something | haste | xsel`
* windows: check out [WinHaste](https://github.com/ajryan/WinHaste)
After running that, the STDOUT output of `cat something` will show up at a URL
which has been conveniently copied to your clipboard.
That's all there is to that, and you can install it with `gem install haste`
right now.
* osx: you will need to have an up to date version of Xcode
* linux: you will need to have rubygems and ruby-devel installed
## Duration
Pastes will stay for 30 days from their last view. They may be removed earlier
and without notice.
## Privacy
While the contents of hastebin.com are not directly crawled by any search robot
that obeys "robots.txt", there should be no great expectation of privacy. Post
things at your own risk. Not responsible for any loss of data or removed
pastes.
Add the following to your bashrc/zshrc
```
export MKR_BIN='https://bin.webionite.com/'
export HASTEBIN=1
```
## Open Source

View File

@ -1,3 +1,4 @@
// vim: set ts=2 sw=2 sts=2 et:
var http = require('http');
var fs = require('fs');
@ -106,14 +107,17 @@ if (config.rateLimits) {
app.use(connect_rate_limit(config.rateLimits));
}
function raw(request, response) {
var key = request.params.id.split('.')[0];
var skipExpire = !!config.documents[key];
return documentHandler.handleRawGet(key, response, skipExpire);
}
// first look at API calls
app.use(route(function(router) {
// get raw documents - support getting with extension
router.get('/raw/:id', function(request, response) {
var key = request.params.id.split('.')[0];
var skipExpire = !!config.documents[key];
return documentHandler.handleRawGet(key, response, skipExpire);
});
router.get('/raw/:id', raw);
router.get('/:id/raw', raw);
// add documents
router.post('/documents', function(request, response) {
return documentHandler.handlePost(request, response);
@ -137,7 +141,7 @@ app.use(connect_st({
// Then we can loop back - and everything else should be a token,
// so route it back to /
app.use(route(function(router) {
router.get('/:id', function(request, response, next) {
router.get('/:id', function(request, _response, next) {
request.sturl = '/';
next();
});