Skip to content

Commit

Permalink
Release v1.2.0
Browse files Browse the repository at this point in the history
* Move to https://oshi.at/ as linx.li had to limit the
  maximum file size to 100KiB.
  Oshi has a limit of 1000 MiB. Uploaded files are stored for 14 days.

* Put "Uploading <filename>" into the clipboard when upload starts.

* Added/updated translations, thanks to:
  Adam Fowler (en_GB), Alexey Lugin (uk), Briseur (fr), Davidmp (ca),
  Emir Sarı (tr), Florentina (ro), Gabriele Baldassarre (it), KapiX (pl),
  Knezzen (sv), mazbrili (id), miqlas (hu), no-act (nl), Schrijvers Luc (nl),
  Sergei Reznikov (ru), TejasMate (hi), TK-313 (ru), tmtfx (fur),
  unspacyar (es), Victor Domingos (pt), zvacet (hr)
  • Loading branch information
Humdinger committed May 31, 2020
1 parent 35efddd commit 7e3b42b
Show file tree
Hide file tree
Showing 24 changed files with 114 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ OPTIMIZE :=
# will recreate only the "locales/en.catkeys" file. Use it as a template
# for creating catkeys for other languages. All localization files must be
# placed in the "locales" subdirectory.
LOCALES = de en
LOCALES = ca de en_GB en es fr fur hi hr hu id it nl pl pt ro ru sv tr uk

# Specify all the preprocessor symbols to be defined. The symbols will not
# have their values set automatically; you must supply the value (if any) to
Expand Down
14 changes: 7 additions & 7 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# UploadIt

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.
UploadIt is a Tracker Add-On that uploads a single file to the online service https://oshi.at. 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.

Currently the expiration time for the uploaded file is hard-coded to 1 week.
Uploaded files can be up to 1000 MiB in size and are stored for 14 days.

### Tips

* Install Clipdinger from HaikuDepot. It includes a "Clipboard Monitor" that you can embed as Replicant on the Desktop. When you see the upload URL appearing there, you know the file was uploaded successfully and the URL can be pasted.

* 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:
```
<pre>
function upload() {
curl -H "Linx-Expiry: 604800" -T "$1" https://linx.li/upload/ | clipboard -i
curl https://oshi.at -F f=@$1 -F expire=20160 | grep "DL:" | awk '{ print $2; }' | clipboard -i
clipboard -p
}
```
</pre>

The number for *Linx-Expiry* is the expiration time in seconds (604800 = 1 week).
The expiration time is set in minutes, 20160 being 14 days

### Manual build/install

* Build with a simple "make".
* Copy UploadIt to ```~/config/non-packaged/add-ons/Tracker.```
* Copy UploadIt to ```~/config/non-packaged/add-ons/Tracker/```.
* For it to actually work, you need to have the curl package installed (```pkgman install cmd:curl```)
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 = 1,
middle = 2,
minor = 0,

/* 0 = development 1 = alpha 2 = beta
Expand Down
5 changes: 5 additions & 0 deletions locales/ca.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Catalan application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On L'UploadIt només es pot usar com a complement del rastreig.\n
Online upload service not available Add-On Servei de càrrega en línia no disponible.
UploadIt only works on a single file, no folders Add-On L'UploadIt només funciona en un sol fitxer i sense carpetes.
Uploading %FILE%… Add-On Uploading %FILE%…
3 changes: 2 additions & 1 deletion locales/de.catkeys
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1 German application/x-vnd.humdinger-UploadIt 496113555
1 German application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt can nur als Tracker Add-on benutzt werden.\n
Online upload service not available Add-On Online Upload-Dienst nicht verfügbar
UploadIt only works on a single file, no folders Add-On UploadIt verarbeitet nur eine einzelne Datei, keine Ordner
Uploading %FILE%… Add-On %FILE% wird hochgeladen…
5 changes: 3 additions & 2 deletions locales/en.catkeys
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1 English application/x-vnd.humdinger-UploadIt 496113555
1 English application/x-vnd.humdinger-UploadIt 1303152328
UploadIt only works on a single file, no folders Add-On UploadIt only works on a single file, no folders
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt can only be used as a Tracker add-on.\n
Uploading '%FILE%'… Add-On Uploading '%FILE%'…
Online upload service not available Add-On Online upload service not available
UploadIt only works on a single file, no folders Add-On UploadIt only works on a single file, no folders
5 changes: 5 additions & 0 deletions locales/en_GB.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 English (British) application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt can only be used as a Tracker add-on.\n
Online upload service not available Add-On Online upload service not available
UploadIt only works on a single file, no folders Add-On UploadIt only works on a single file, no folders
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/es.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Spanish application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt sólo puede ser usado como Tracker add-on.\n
Online upload service not available Add-On No está disponible el servicio de subida en línea
UploadIt only works on a single file, no folders Add-On UploadIt sólo funciona sobre archivos individuales, no sobre carpetas
Uploading %FILE%… Add-On Subiendo %FILE%…
5 changes: 5 additions & 0 deletions locales/fr.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 French application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt ne peut être utilisé que comme extension du Tracker.\n
Online upload service not available Add-On Service de mise en ligne non disponible
UploadIt only works on a single file, no folders Add-On UploadIt fonctionne uniquement avec un fichier seul, pas de dossiers
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/fur.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Friulian application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt al pues jessi doprât dome come component adizionâl di Tracker.\n
Online upload service not available Add-On Servizi di cjariament online no disponibil
UploadIt only works on a single file, no folders Add-On UploadIt al lavore dome cui file singui, no cun cartelis
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/hi.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Hindi application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt का उपयोग केवल Tracker add-on के रूप में किया जा सकता है\n
Online upload service not available Add-On ऑनलाइन अपलोड़ सेवा उपलब्ध नहीं है
UploadIt only works on a single file, no folders Add-On UploadIt केवल बिना फो़ल्डर के एक फा़इल ही अपलोड कर सकता है
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/hr.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Croatian application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt se može koristiti kao Tracker dodatak.\n
Online upload service not available Add-On Mrežni servis slanja nije dostupan
UploadIt only works on a single file, no folders Add-On UploadIt radi jedino sa pojedinačnom datotekom, ne i sa mapama
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/hu.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Hungarian application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt csak Tracker bővítményként használható.\n
Online upload service not available Add-On A feltöltő szolgáltatás nem érhető el
UploadIt only works on a single file, no folders Add-On UploadIt csak fájlokat képes feltölteni, könyvtárakat nem
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/id.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Indonesian application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt hanya dapat digunakan sebagai pengaya Tracker.\n
Online upload service not available Add-On Layanan unggahan online tidak tersedia
UploadIt only works on a single file, no folders Add-On UploadIt hanya berfungsi pada satu file, tidak ada folder
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/it.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Italian application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt può essere utilizzato solo come add-on del Tracker.\n
Online upload service not available Add-On Servizio di upload nonline non disponibile
UploadIt only works on a single file, no folders Add-On UploadI funziona unicamente con singoli file, non cartelle
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/nl.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Dutch application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt kan alleen gebruikt worden als een Tracker-add-on.\n
Online upload service not available Add-On Online upload-dienst niet beschikbaar
UploadIt only works on a single file, no folders Add-On UploadIt werkt alleen met individuele bestanden, en niet met mappen
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/pl.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Polish application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt może być używany tylko jako dodatek Trackera.\n
Online upload service not available Add-On Sieciowa usługa wysyłania jest niedostępna
UploadIt only works on a single file, no folders Add-On UploadIt działa tylko na pojedynczych plikach, nie katalogach
Uploading %FILE%… Add-On Wysyłanie %FILE%…
5 changes: 5 additions & 0 deletions locales/pt.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Portuguese application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On O UploadIt apenas pode ser utilizado como um 'add-on' do Tracker.\n
Online upload service not available Add-On Serviço de carregamento online não disponível
UploadIt only works on a single file, no folders Add-On O UploadIt funciona apenas com um ficheiro único, não com pastas
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/ro.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Romanian application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt poate fi utilizat doar ca supliment de Tracker.\n
Online upload service not available Add-On Serviciul de încărcare online nu este disponibil
UploadIt only works on a single file, no folders Add-On UploadIt funcționează doar cu un singur fișier, fără dosare
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/ru.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Russian application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt может использоваться только как дополнение Tracker.\n
Online upload service not available Add-On Сервис онлайн-загрузок недоступен
UploadIt only works on a single file, no folders Add-On UploadIt работает только с отдельными файлами, а не с папками
Uploading %FILE%… Add-On Выгружается %FILE%…
5 changes: 5 additions & 0 deletions locales/sv.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Swedish application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt kan bara användas som ett tillägg till Tracker.\n
Online upload service not available Add-On Uppladdningsservice online är inte tillgängligt
UploadIt only works on a single file, no folders Add-On UploadIt funkar bara med enskilda filer, inte med mappar
Uploading %FILE%… Add-On Uploading %FILE%…
5 changes: 5 additions & 0 deletions locales/tr.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Turkish application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt yalnızca bir İzleyici eklentisi olarak kullanılabilir.\n
Online upload service not available Add-On Çevrimiçi yükleme servisi kullanılamıyor
UploadIt only works on a single file, no folders Add-On UploadIt yalnızca tek bir dosya ile çalışır, klasörlerle kullanılamaz.
Uploading %FILE%… Add-On %FILE% yükleniyor…
5 changes: 5 additions & 0 deletions locales/uk.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Ukrainian application/x-vnd.humdinger-UploadIt 3369103846
UploadIt can only be used as a Tracker add-on.\n Add-On UploadIt можна використовувати лише як додаток Tracker’а.\n
Online upload service not available Add-On Служба відвантаження в Інтернет недоступна
UploadIt only works on a single file, no folders Add-On UploadIt працює лише з окремими файлами, а не з каталогами
Uploading %FILE%… Add-On Uploading %FILE%…
18 changes: 10 additions & 8 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018. All rights reserved.
* Copyright 2018-2020. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Author:
Expand All @@ -8,7 +8,7 @@
* Modified code from CopyNameToClipboard
* _CheckNetworkConnection() borrowed from SoftwareUpdater
*/

#include <stdio.h>
#include <stdlib.h>

Expand Down Expand Up @@ -79,13 +79,15 @@ process_refs(entry_ref directoryRef, BMessage* msg, void*)
CopyToClipboard(text);
} else {
entry.GetPath(&path);
BString text(B_TRANSLATE("Uploading '%FILE%'" B_UTF8_ELLIPSIS));
text.ReplaceAll("%FILE%", path.Leaf());
CopyToClipboard(text);

BString command(
// 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 ; "
"curl https://oshi.at -F f=@\"%FILEPATH%\" -F expire=20160 "
"| grep \"DL:\" | awk '{ print $2; }' | clipboard -i ; "
"exit");
command.ReplaceAll("%FILENAME%", path.Path());
command.ReplaceFirst("%FILEPATH%", path.Path());
system(command.String());
}
}
Expand All @@ -96,5 +98,5 @@ int
main(int, char**)
{
fprintf(stderr, B_TRANSLATE("UploadIt can only be used as a Tracker add-on.\n"));
return -1;
return -1;
}

0 comments on commit 7e3b42b

Please sign in to comment.