Python/Perl/Bash script for uploading needed

linkchilla

Network license
License owner
Joined
Aug 31, 2017
Messages
60
Points
58
Location
Northern Germany
Hi,..

is anyone willing to share his python/perl or bash script for bulk uploading? I need to stuff my newborn server with some images for testing. Any state of development is welcome, I'm simply to lazy to start from scratch at the moment. Thank you!
 

linkchilla

Network license
License owner
Joined
Aug 31, 2017
Messages
60
Points
58
Location
Northern Germany
Well, then this quick and dirty bash one-liner must do it:
Code:
for i in $(ls *.{jpg,png,bmp,gif} 2>/dev/null); do curl --form "source=@"$i"" "https://www.linkchilla.com/api/1/upload/?key=d13c465fd57f8fe929b27f4e9de5af6a&format=txt";echo -e ""; done;
Flood protection temporally disabled, of course.

@Rodolfo: That var "action=upload" isn't used at all at the moment, right?
 

linkchilla

Network license
License owner
Joined
Aug 31, 2017
Messages
60
Points
58
Location
Northern Germany
I meant something like this:

valid:
Code:
.../api/1/upload/?key=12345&format=txt"
not (yet?) valid:
Code:
.../api/1/?key=12345&action=upload&format=txt"
I may have misunderstood the docs, but the last one theoretical should also work, even if there is only one action (upload) yet. Anyway, this is my first approach to the api, so be gentle. :)
 

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
15,459
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com
?action was used in Chevereto 2 API and for legacy concerns it got preserved. Current API only needs /action/

Here, check this one:
Code:
https://demo.chevereto.com/api/1/upload/?key=23bc46fa71a4d45c0153ef07201221db&source=https://unsplash.it/1920/1080&format=json