Created
November 29, 2012 16:50
-
-
Save poritsky/4170303 to your computer and use it in GitHub Desktop.
Download Mike D'Angelo's Master List of Films released in NYC for TaskPaper/OmniOutliner/Plain Text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Use this AppleScript to Download any of the master lists maintained my Mike D'Angelo: | |
-- http://www.panix.com/~dangelo/ | |
-- | |
-- Script will only work if you visit one of his list pages in Safari then run it from Script Editor. | |
-- Will still run on other sites but will output nonsense. | |
-- | |
-- Saves a .txt that will open in any text editor or OmniOutliner, but won't open directly in TaskPaper. | |
-- Simply copy and paste the resulting text into a new TaskPaper document if you prefer. | |
tell application "Safari" to set listurl to URL of front document | |
set films to (do shell script "curl " & listurl & " | sed -e 's/<[^>]b>/:/' -e 's/<br>/<p>/g' | textutil -convert txt -stdin -stdout | grep '.' | sed -e '/(Films seen by/d' -e '/^Week/!s/^/ - /'") | |
set fn to choose file name with prompt "Name this file" default name "Movie List.txt" default location (path to desktop folder) | |
tell application "System Events" | |
set fid to open for access fn with write permission | |
write films to fid | |
close access fid | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment