Skip to content

Commit

Permalink
Change online service to 'Linx'
Browse files Browse the repository at this point in the history
Since the "Null Pointer" at https://0x0.st has been unreliable,
switch to "Linx" at https://linx.li .

Expiration time is currently hardcoded to 1 day.
  • Loading branch information
Humdinger committed Nov 3, 2019
1 parent ed9dd21 commit 35efddd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 32 deletions.
37 changes: 7 additions & 30 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
# UploadIt

UploadIt is a Tracker Add-On that uploads a single file to the online service *The Null Pointer* at https://0x0.st . The URL for the uploaded file is put into the clipboard after the upload has finished, ready to be pasted into an email, a chat window or forum post.
UploadIt is a Tracker Add-On that uploads a single file to the online service *Linx* at https://linx.li. The URL for the uploaded file is put into the clipboard after the upload has finished, ready to be pasted into an email, a chat window or forum post.

According to *The Null Pointer* website:

* Maximum file size: 512.0 MiB
* Not allowed: application/x-dosexec, child pornography
* File URLs are valid for at least 30 days and up to a year, depending on file size:
```
days
365 | \
| \
| \
| \
| \
| \
| ..
| \
197.5 | ----------..-------------------------------------------
| ..
| \
| ..
| ...
| ..
| ...
| ....
| ......
30 | ....................
0 256 512
MiB
```
Currently the expiration time for the uploaded file is hard-coded to 1 week.

### Tips

Expand All @@ -38,9 +11,13 @@ According to *The Null Pointer* website:
* UploadIt uses a curl command line that does all the work. You can put the line into your ```~/config/settings/profile``` and use "upload" from Terminal:
```
function upload() {
curl -F'file=@'$1 https://0x0.st | clipboard -i
curl -H "Linx-Expiry: 604800" -T "$1" https://linx.li/upload/ | clipboard -i
clipboard -p
}
```

The number for *Linx-Expiry* is the expiration time in seconds (604800 = 1 week).

### Manual build/install

* Build with a simple "make".
Expand Down
2 changes: 1 addition & 1 deletion UploadIt.rdef
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource app_flags B_SINGLE_LAUNCH;

resource app_version {
major = 1,
middle = 0,
middle = 1,
minor = 0,

/* 0 = development 1 = alpha 2 = beta
Expand Down
6 changes: 5 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>

#include <Alert.h>
#include <Catalog.h>
#include <Clipboard.h>
#include <Entry.h>
Expand Down Expand Up @@ -79,7 +80,10 @@ process_refs(entry_ref directoryRef, BMessage* msg, void*)
} else {
entry.GetPath(&path);
BString command(
"curl -F'file=@'\"%FILENAME%\" https://0x0.st | clipboard -i ; "
// 0x0.st has been quite unreliable
// "curl -F'file=@'\"%FILENAME%\" https://0x0.st | clipboard -i ; "
// switching to linx.li instead (expire in one week (60*60*24*7)
"curl -H \"Linx-Expiry: 604800\" -T \"%FILENAME%\" https://linx.li/upload/ | clipboard -i ; "
"exit");
command.ReplaceAll("%FILENAME%", path.Path());
system(command.String());
Expand Down

0 comments on commit 35efddd

Please sign in to comment.