Commits

Trammell Hudson committed 4bebf50 Draft

twitter fetch/filter

Comments (0)

Files changed (2)

+#!/usr/bin/perl
+use warnings;
+use strict;
+use HTML::Strip;
+
+local $/;
+$_ = <>;
+
+my $n = 0;
+
+while (m!<p class="js-tweet-text.*?">(.*?)</p>!msg)
+{
+	next if $n++ < 5;
+
+	my $hs = HTML::Strip->new;
+	print $hs->parse($1), "\n";
+	last;
+}
+
+
+__END__
+<p class="js-tweet-text tweet-text">&quot;We can throw stones, complain about them, stumble on them, climb over them, or build with them.&quot; - William <strong>Arthur</strong> Ward</p>
+#!/bin/sh
+
+while true; do
+	( \
+	echo '
+	sleep 2 ; \
+	curl 'https://twitter.com/search?q=i' | ./tweet-filter ; \
+	) > /dev/tty.usbmodem12341
+	sleep 15
+done