Skip to content

Instantly share code, notes, and snippets.

View cmstone's full-sized avatar

Chris Stone cmstone

View GitHub Profile
@shiflett
shiflett / gist:d98f8f37c4b7bcd25de1
Last active April 1, 2016 03:48
Scrape a Twitter Profile for Bio
#! /bin/bash
# Based on https://gist.github.com/scoates/5935435
for u in $*; do
echo $u
curl -sL http://twitter.com/$u > /tmp/tw.html
cat /tmp/tw.html | grep '<title' | perl -pe 's/.*?>//;s/ \(.*//'
cat /tmp/tw.html | grep ProfileAvatar-image | head -n1 | perl -p -e's/.*?http/http/;s/".*//'
cat /tmp/tw.html | grep ProfileHeaderCard-bio -a2 | tail -n1 | perl -pe 's/.*?>(.*)<\/p>/\1/;s/<.*?>//g'
@fdob
fdob / gist:5983637
Last active November 30, 2022 01:14
in-diff: Use inotify to capture changes to a file, and output diffs to STDOUT. Needs inotify-tools.
#!/bin/bash
# hook into inotify to watch a file, and generate
# diffs for changes in real-time
#
# requires inotify-tools (apt-get install inotify-tools)
#
# @author Filipe Dobreira <filipe.dobreira@ez.no>
usage() {
echo "Usage:"
echo " in-diff <file>|help"