Linux Screenshot Upload

Tuesday, September 11, 2007 by Michael H. Pryor

Here's a batch script that Branimir wrote to do a file upload from Linux:

#!/bin/sh
## A simple demonstration of using FogBugz 6 API from Unix shell

## by branimir@fogcreek.com
## Grabs the whole screen and sends it to FogBugz

## Requires ImageMagick, curl

BASE=https://my.fogbugz.com

EMAIL=me@example.com
PASS=BigGnus
# Grab the screen

import -window root screenshot.png

# Find the API URL (usually something like FogBugz/api.asp)
URL=`curl $BASE/api.xml | sed -n 's/^.*\(.*\)<\/url>.*$/\1/p'`

# Logon to FogBugz

TOKEN=`curl "${BASE}/${URL}cmd=logon&email=$EMAIL&password=$PASS" | sed -n 's/^.*\(.*\)<\/token>.*$/\1/p'`

# Send the screenshot

curl -F"token=$TOKEN" -F"cmd=new" -F"sTitle=New Screenshot" -F"File1=@screenshot.png" $BASE/$URL

Categories: FogBugz
Tags:
Actions: E-mail | Permalink