Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (26 sloc) 1.242 kb
<cfcomponent accessors="true">
<cfproperty name="Crouton" type="Crouton" />
<cfproperty name="PageURL" type="string" default="http://www.amazon.com/mobile-apps/b/?node=2350149011" />
<cffunction name="init" returntype="AmazonApp">
<cfargument name="Crouton" type="Crouton" required="yes" />
<cfset setCrouton( Arguments.Crouton ) />
<cfreturn this />
</cffunction>
<cffunction name="getDaily" returntype="string">
<cfset var XML = getCrouton().parse( getPageURL() ) />
<cfset var Img = XMLSearch( XML, "//div[@class='fad-widget-large-artwork']//img" )[1].XmlAttributes.Src />
<cfset var AppName = XMLSearch( XML, "//div[@class='app-info-name']/a" )[1].XMLText />
<cfset var BuyLink = XMLSearch( XML, "//div[@class='app-info-name']/a" )[1].XmlAttributes.Href />
<cfset var Description = XMLSearch( XML, "//img[@class='fad-widget-large-description']" )[1].XMLAttributes.Alt />
<cfset var EmailContents = '' />
<cfsavecontent variable="EmailContents">
<cfoutput>
<h1>Amazon Daily Android App</h1>
<h2><a href="http://amazon.com#BuyLink#">#AppName#</a></h2>
<img src="#Img#" />
<p>#Description#</p>
</cfoutput>
</cfsavecontent>
<cfreturn EmailContents />
</cffunction>
</cfcomponent>
Jump to Line
Something went wrong with that request. Please try again.