[4-ch] [sh] Keep Updated on New 4-ch Posts [tools] (7)

1 Name: #!/usr/bin/anonymous : 2016-10-19 12:44 ID:Lop6cfV3 This thread was merged from the former /code/ board. You can view the archive here.

Here's a script to help keep updated on new 4-ch posts since your last visit.

It downloads the HTML of each board and compares against the HTML from last time. If anything changed it lists that board as [NEW].

Makes it easy to look for new posts, you can edit the boards.txt file to only check on boards you are interested in checking.

2 Name: #!/usr/bin/anonymous : 2016-10-19 12:45 ID:Lop6cfV3

boards.txt:

[code]
general
dqn
iaa
img
req
tv
anime
manga
games
music
book
ascii
fashion
food
hobby
love
personal
sexual
code
tech
net
news
politics
debate
science
sports
language
nihongo
nordic
[/code]

3 Name: #!/usr/bin/anonymous : 2016-10-19 12:46 ID:Lop6cfV3

#!/bin/sh

mkdir -p html

while read board; do
mv "html/$board.new.html" "html/$board.old.html"
curl -s -o "html/$board.new.html" "http://4-ch.net/$board/"
if ! diff -q "html/$board.new.html" "html/$board.old.html" > /dev/null 2>&1; then
echo "[NEW] http://4-ch.net/$board/"
fi
done <boards.txt

4 Name: #!/usr/bin/anonymous : 2016-10-19 17:05 ID:Heaven

How is this more advantageous than using an RSS reader for the boards that you do want to see?

Not that this is a bad exercise, I just don't see it a s too useful.

5 Name: #!/usr/bin/anonymous : 2016-10-20 00:56 ID:Lop6cfV3

>>4
you're welcome to use RSS...

6 Name: #!/usr/bin/anonymous : 2016-10-23 09:54 ID:Heaven

>>4
Every neat idea in the history of programming has a comment like this

7 Post deleted.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: