#!/bin/bash # Strip cat, we only need the pkg name sfpkg="`echo ${1} | sed -e "s|^.*/||g"`" # Take care of outputting the version number pwd="`pwd`" if ! test -d "${pwd}/${sfpkg}-tmp" ; then mkdir "${pwd}/${sfpkg}-tmp" fi cd "${pwd}/${sfpkg}-tmp" wget --quiet --tries=1 --timeout=3 "http://sourceforge.net/projects/${sfpkg}/" -O indexfile projnum=`grep -i 'project/showfiles.php?group_id.*Files' indexfile | sed -e "s|^
  • .*||g"` wget --quiet --tries=1 --timeout=3 "http://sourceforge.net/export/rss2_projfiles.php?group_id=${projnum}" -O rssfeed grep -i "${sfpkg} " rssfeed | head -n 1 | sed -e "s|^.*<title>${sfpkg} ||gI" | sed -e "s| released .*.*||g" | sed -e "s|^[A-Za-z _-]*||g" | sed -e "s|-[cCe-oE-OqQs-zS-Z]\{1\}.*||g" rm -Rf "${pwd}/${sfpkg}-tmp"