Created
February 6, 2012 21:05
-
-
Save andrewrcollins/1754862 to your computer and use it in GitHub Desktop.
OpenClipArt Collection Uploader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| AGENT="Mozilla/5.0 (Windows NT 5.1; rv:10.0) Gecko/20100101 Firefox/10.0" | |
| SIGNIN="http://openclipart.org/signin" | |
| USERNAME=xxxxxxxxxxx | |
| PASSWORD=yyyyyyyyyyy | |
| curl --cookie-jar cookies --user-agent "${AGENT}" --data "username=${USERNAME}&password=${PASSWORD}&process=login&submit=Sign in" --output "signin.html" "${SIGNIN}" | |
| COLLECTION=COLLECTION_ID | |
| for ID in CLIP_ID_1 CLIP_ID_2 CLIP_ID_LAST | |
| do | |
| COLLECT="http://openclipart.org/index.php?pretty=collection/collection-add/${COLLECTION}/${ID}" | |
| curl --cookie cookies --cookie-jar cookies --user-agent "${AGENT}" \ | |
| --form image_id="image id" \ | |
| --form set_list_id="set list id" \ | |
| --form date_added="date added" \ | |
| --form form_id="109" \ | |
| --form add_to_form="Add Clip Art" \ | |
| --output "collect.html" "${COLLECT}" | |
| sleep 1s | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment