#!/bin/bash
echo "getting friends list:"
curl http://twitter.com/statuses/friends/cnawan.xml > cnawans-friendlist.xml
echo "trimming friends list:"
grep "/profile_image_url" cnawans-friendlist.xml >
cnawans-friends-pictures.txt
echo "more trimming"
sed -i 's/<profile_image_url>//g' cnawans-friends-pictures.txt
echo "yet more trimming:"
sed -i 's/<\/profile_image_url>//g' cnawans-friends-pictures.txt
echo "getting friends pictures:"
wget --input-file=cnawans-friends-pictures.txt
echo "averaging pictures:"
convert -average *.jpg cnawans-friends-pictures-averaged.jpg
..and set it as my userpic with a cron job like the others:
curl --header "Expect:" -F
'image=@/home/../cnawans-friends-pictures-averaged.jpg' -u
USERNAME:PASSWORD http://twitter.com/account/update_profile_image.xml
As it stands, it only uses the jpgs, not the few pngs that are on the list. I might adapt the script to do them all, but the jpgs tend to be photos more often and make the averaged image look more like a spooky face. :)
No comments:
Post a Comment