Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # A Makefile using the Metafilter infodump to see how often a user's
- # first post is an obituary post.
- FIRSTPOSTID=70000
- default: obitpostids postdata_mefi.txt firstobitposts firstposts
- @echo "Number of obit posts: $$(wc -l obitpostids |cut -f1 -d' ')"
- @echo "Total number of posts: $$(awk -F"\t" '$$1 >= $(FIRSTPOSTID) {print $$1}' postdata_mefi.txt |wc -l |cut -f1)"
- @echo "Number of first posts that are obit posts: $$(wc -l firstobitposts |cut -f1 -d' ')"
- @echo "Total number of first posts: $$(wc -l firstposts |cut -f1 -d' ')"
- firstobitposts: firstposts obitpostids
- join firstposts obitpostids >$@
- firstposts: postdata_mefi.txt
- tr -d '\r' <$< |sed 1,2d |awk -F"\t" '{if ($$2 in a) next; a[$$2] = $$1; if ($$1 >= $(FIRSTPOSTID)) print}' |sort -k1b,1 >$@
- obitpostids: tagdata_mefi.txt
- tr -d '\r' <$< |sed 1,2d |awk -F"\t" '$$4 ~ /^[oO]bit/ && $$2 >= $(FIRSTPOSTID) {print $$2}' |sort -u -k1b,1>$@
- clean:
- rm firstobitposts firstposts obitpostids
- %.txt: %.txt.zip
- unzip $<
- %.txt.zip:
- wget http://stuff.metafilter.com/infodump/$@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement