Created
September 11, 2012 07:00
-
-
Save cgrusden/3696556 to your computer and use it in GitHub Desktop.
Add images to model mayhem with this bookmarklet-ish
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
| javascript:(function(){ | |
| _my_script=document.createElement('SCRIPT'); | |
| _my_script.type='text/javascript'; | |
| _my_script.src='https://raw.github.com/gist/3696556/5ca9ff6c6c386ea8ca7ed4568abb3f2b33160d98/model_mayhem.js?'; | |
| document.getElementsByTagName('head')[0].appendChild(_my_script); | |
| })(); |
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
| function get_url(id) { | |
| $.get("http://www.modelmayhem.com/"+id, {async:false, dataType:"text"}, function(data) { | |
| url = $(data).find('.big_image').attr("src"); | |
| $(".profile_photo_"+id).attr("src", url); | |
| }); | |
| } | |
| $("span a.camlink").each(function(elem) { | |
| profile_id = $(this).attr("numotherid"); | |
| img = $(document.createElement("img")); | |
| img.addClass("big_image"); | |
| img.addClass("profile_photo_"+profile_id) | |
| $(this).parent().append(img); | |
| get_url(profile_id); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment