【问题标题】:Automate ImageShack upload自动上传 ImageShack
【发布时间】:2011-07-26 02:01:22
【问题描述】:

我不知道如何制作一个脚本来将图片上传到 ImageShack,并在 BASH 中返回图片的热链接,有人可以帮我做一个吗?我正在考虑使用 curl。

【问题讨论】:

    标签: bash curl imageshack


    【解决方案1】:

    这是我的解决方案:

    #!/bin/bash
    
    if [ $# -ne 1 ]
    then
      echo "Usage: `basename $0` filename"
      exit
    fi
    
    image="$1"
    mimetype=`file -b --mime-type $image`
    
    curl -H Expect: -F "fileupload=@$image;type=$mimetype" -F xml=yes -# "http://post.imageshack.us/" | grep image_link | grep -o  http[^\<]*
    

    如果您不喜欢进度条,只需将-# 替换为-s

    【讨论】:

      猜你喜欢
      • 2012-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-22
      • 1970-01-01
      相关资源
      最近更新 更多