Advertisement
Guest User

How often is a Metafilter user's first post an obit post?

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