pixhost.org BASH upload script
If you are familiar with BASH scripts, thought I'd post this in case someone wanted to modify it for their needs.
READ THE WARNING IN THE SCRIPT COMMENTS OR YOU'LL SCREW THIS UP. - BBCODE won't let me post it as-is. Code:
#!/bin/bash Feel free to tweak and repost a better version that is more adaptable to all. Just sharing in case it helps someone get started on their own script. If you don't know what you're doing—Don't. You've been warned. Here it is in action. https://www.youtube.com/watch?v=T4-anPkVvfg |
Quote:
Code:
#!/bin/bash Quote:
|
Thanks. That's what I needed.
|
It appears that you're not making galleries..?
Just wondering. I was going to work on redoing my upload scripts after I had downloaded and sorted my images from imagebam. I had used PHP to do my previous upload script. I would just point it to a folder and it would upload each image in that folder ascending alphabetically. Script would take 2 arguements: name of gallery, folder path I was planning to retrofit some pieces into a new script to upload for pixhost that way you could note your gallery links and use them. Code:
<?php Code:
{ "gallery_name": "Test gallery", "gallery_hash": "8NtKF", "gallery_url": "http:\/\/pixhost.to\/galleries\/8NtKF", "gallery_upload_hash": "yKtOl8NbHMYJ8yWj8Mh90sIlfXC7PXT6RHW8Xua7" } You get the response back from the API in json format, and using json_decode function in PHP you could get rid of all of the sed calls you make to pull out the image link. With php it would come back from the curl call as a reponse ($curl_response) Then just json decode and you would have an object you could call Code:
$resp=json_decode($response); |
Yeah, I didn't do galleries. Still not very good at PHP (or bash scripting for that matter). Thanks for sharing your method!
|
Quote:
Then I need to figure out my upload method, then figure out editing my posts with the new image links. One thing I will mention to others for the future is to use galleries, but to also use unique names if you can. The majority of my galleries are uniquely named, so my plan is to script a way to edit my posts and use the post title to find the gallery, then insert the new image links in place of the old. I have yet to do an index of the post ID and title of each of my posts as of yet, but I will. It will take a while since I have 13000 posts... |
Quote:
|
I learned bash scripting because I do a ton of file manipulation and lots of repetitive processes in OSX/Linux. Most of my stuff is quick and dirty—sort life stuff. Never been disciplined enough to get down and write beautiful code.
|
pixhostuploader
I have just stumbled upon a pixhost uploader written in Python. Did not try it yet, but it might be a reasonable alternative to home-grown bash or php scripts.
EDIT: After a cursory look at the code I'm positive there is no gallery support whatsoever, which is bad. :( |
Quote:
For me galleries are a huge part of my upload process. I have logic that determines if the number of total images is over 125 (post limit of thumbnails) then I should only select 4 image thumbnails and the gallery link instead. One thing that surprises me about pixhost is that the gallery ID is only 5 characters. It still provides 916132832 possible combinations with upper, lower, and number characters, so it's probably enough. Imagebam used 32 characters for their gallery hash. |
All times are GMT. The time now is 04:42 AM. |
vBulletin Optimisation provided by
vB Optimise v2.6.1 (Pro) -
vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.