Skip to content

Instantly share code, notes, and snippets.

@SebDeclercq
Created May 6, 2013 10:19
Show Gist options
  • Save SebDeclercq/5524339 to your computer and use it in GitHub Desktop.
Save SebDeclercq/5524339 to your computer and use it in GitHub Desktop.
(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