V
V
Vlad Zaitsev2014-03-02 03:19:56
habrastorage.org
Vlad Zaitsev, 2014-03-02 03:19:56

Habrastorage: how to load from the console?

Some time ago I wrote a script for loading pictures on habrastorage: habrahabr.ru/post/207282
But TM updated the storage, and now the download does not work. Previously the following command was used:

curl -F "[email protected]/Users/vvzvlad/Documents/REVIEWS/alpha\ mio/foto/003.jpg" "http://habrastorage.org/uploadController/?username=vvzvlad&userkey=7a25d94cde460365b6f7ce137675c623ec"

Can anyone tell me how to download now?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
avalak, 2014-03-02
@vvzvlad

#!/usr/bin/env bash

upload_to_habrastorage () {
  # --verbose для отладки
  curl \
    --cookie "habrastorage_sid=${1}" \
    --form "files[][email protected]${2}" \
    --header "X-Requested-With: XMLHttpRequest" \
    --header "Referer: http://habrastorage.org/" \
    --request POST \
      http://habrastorage.org/main/upload
}

upload_to_habrastorage "you_sid" "filename"

R
Ruslan, 2014-03-03
@ruslash

You can add something else that would work on the shortcut and include screencapture, it's cooler.

now=$(date +"%H%M%S%d%m%Y")
screencapture -s /Volumes/%username%/screenshoots/$now.png

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question