Created
March 19, 2013 13:46
-
-
Save jbuda/5196217 to your computer and use it in GitHub Desktop.
MangoBlog and Twitpic coldfusion
This file contains 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
<cfset urlstring = 'http://twitpic.com/photos/jbuda' /> | |
<cfhttp url="#urlstring#" method="get" /> | |
<cfset rawUrl = toString(cfhttp.filecontent) /> | |
<cfset pos = 1 /> | |
<cfset imageArray = arrayNew(1) /> | |
<cfset regexp = '>div class="profile-photo-img"<(.*?)>/div<' /> | |
<cfset found = refindnocase(regexp,rawUrl,pos,true) /> | |
<cfloop condition="pos lt len(rawUrl)"> | |
<cfset found = refindnocase(regexp,rawUrl,pos,true) /> | |
<cfset pos = found.pos[1] + found.len[1] /> | |
<cfif found.len[1] eq 0> | |
<cfbreak /> | |
<cfelse> | |
<cfset img = mid(rawUrl,found.pos[2],found.len[2]) /> | |
<cfset arrayAppend(imageArray,img) /> | |
</cfif> | |
</cfloop> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment