Created
May 6, 2013 10:19
-
-
Save SebDeclercq/5524339 to your computer and use it in GitHub Desktop.
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
(defun classic21-currently-playing () | |
(interactive) | |
(url-copy-file "http://www.rtbf.be/classic21/conducteur" "/tmp/classic21.html") | |
(find-file "/tmp/classic21.html") | |
(goto-char 1) | |
(setq song-start (search-forward "<h4>Titre: <strong>") | |
song-end (- (search-forward "</") 2) | |
singer-start (search-forward "<p>Artiste: <strong>") | |
singer-end (- (search-forward "</") 2)) | |
(message "%s\n%s –– %s" | |
#("Classic 21 (currently playing) :" 0 32 (face bold)) | |
(buffer-substring singer-start singer-end) | |
(buffer-substring song-start song-end)) | |
(kill-buffer "classic21.html") | |
(delete-file "/tmp/classic21.html")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment