Monday, 23 November 2009
'things that go bump in the tunnel'
As I've beem following the LHC restart I've written a parser for the vistar status feed to send it to twitter. The basic method is:
Grab URL (see image) then do some imagemagick hackery to cut out the corner. Resize larger (helps with the OCR) and save as tiff. Run the image through OCR software, compare the output to the last run, if different then upload to twitter.
curl -o $IMG $SRC
convert $IMG +repage -crop 509x205+1+533 -resize 1000x -threshold 39000 $IMG
convert -monochrome $IMG $TIFF
mv $OUT.txt $OUT.old # make a backup of old
tesseract $TIFF $OUT
# Strip out ready for Twitter
sed -i "s/Comments $DATE /#LHC Status /" $OUT.txt
diff -q $OUT.txt $OUT.old
if [ $? -eq 1 ] ; then
# Post to Twitter.
curl --basic --user lhcstatus:password --data status="`cat $OUT.txt`" http://twitter.com/statuses/update.json
and lo: http://twitter.com/lhcstatus
As previously blogged , I've got a couple of 12v 88.7A PSUs that I'm trying to control under arduino. Stage 1 complete - It powers ...
At home we have a small (2.5KW - 10*250w panels) PV system to try and offset our daytime electricity usage. This is connected to a 'Grow...
Some time ago I picked up a couple of ESP-01 modules with the intention of using them as wireless temperature/humidity sensors coupled with...
What does a geek do when they have some spare RGB LED strip (addressable WS2812B) and some cheap nasty LED devices? LED transplant time... ...