Permalink
Browse files

Fixing 9gag update to their IMG src, they no longer include http/http…

…s in their img src tags, so appending if it is not automatically found.
  • Loading branch information...
1 parent e0f362b commit 642b9d2234100d74a10725c482c7d9d36f5cb901 @lincsanders lincsanders committed Jul 23, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/scripts/9gag.coffee
@@ -34,7 +34,12 @@ send_meme = (message, location, response_handler)->
location = response.headers['location']
return send_meme( message, location, response_handler )
- response_handler get_meme_image( body, ".img-wrap img" )
+ img_src = get_meme_image( body, ".img-wrap img" )
+
+ if img_src.substr 0,4 != "http"
+ img_src = "http:#{img_src}"
+
+ response_handler img_src
get_meme_image = (body, selector)->
html_handler = new HTMLParser.DefaultHandler((()->), ignoreWhitespace: true )

0 comments on commit 642b9d2

Please sign in to comment.