Skip to content

Instantly share code, notes, and snippets.

@codebycliff
Created January 20, 2014 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codebycliff/8512792 to your computer and use it in GitHub Desktop.
Save codebycliff/8512792 to your computer and use it in GitHub Desktop.
Bash functions for interacting with the freshmeat API.
#!/bin/bash
FRESHMEAT_TOKEN=xtJ4zwGPM14iBmKnledd
DATA="auth_code=$FRESHMEAT_TOKEN"
ROOT="http://freshmeat.net"
function get {
[ -z "$1" ] && echo "Error: Must supply request path." && return
echo $(curl -G -d $DATA $ROOT/${1})
}
function get_project () {
echo $(get projects/${1}.${2-json})
}
function get_tags () {
echo $(get tags/all.${1-json})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment