<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
    <atom:link href="http://www.williamlang.net/rss.php" rel="self" type="application/rss+xml" />
    <title>WilliamLang.net News and Updates</title>
    <link>http://www.williamlang.net</link>
    <description>News and updates for http://www.williamlang.net</description>
	<pubDate>Wed, 08 Feb 2012 06:15:35 +0000</pubDate>
    <lastBuildDate>Wed, 08 Feb 2012 06:15:35 +0000</lastBuildDate>
    <language>en-us</language>
	<item>
		<title>EvoNews: The Genetic News Aggregate</title>
		<link>http://www.williamlang.net/News/11-EvoNews:-The-Genetic-News-Aggregate</link>
		<description><![CDATA[ <p><strong>What is EvoNews?</strong></p>
<p>EvoNews is a genetic news aggregate.</p>

<p>I created EvoNews as a final project for my Evolutionary Computation and Artificial Life course at Carleton. It uses a genetic algorithm to determine the ultimate news homepage based on what you like and dislike.</p>

<p>Check it out at <a href="http://evonews.williamlang.net">http://evonews.williamlang.net</a></p> ]]> </description>
		<guid>http://www.williamlang.net/News/11-EvoNews:-The-Genetic-News-Aggregate</guid>
	</item>
	<item>
		<title>Choosing Random MySQL Records</title>
		<link>http://www.williamlang.net/News/10-Choosing-Random-MySQL-Records</link>
		<description><![CDATA[ <p>I recently came accross a need to choose a random record from a table in my database. I wasn't completely sure how I would do this in CakePHP as I was just getting started with the MVC framework.</p>
<p>CakePHP makes it easier to do this by turning a step into one line.</p>
<p>What you need to do:</p>
<ol>
<li>Determine how many records there are in the table</li>
<li>Choose one of those records</li>
</ol>
<p>So, how do we do it?</p>
<p>First off, a simple COUNT(*) on the table will return how many records there are. In CakePHP its as simple as calling find('count') on the model with no conditions. Choosing one of the records <em>can </em>be tricky and can be easy to overthink.</p>
<p>With the MySQL LIMIT clause we can specify an offset and a set size. (LIMIT [offset, ] set size)</p>
<p>The offset is our random number we will generate using PHP's rand() function. Remember, records are returned with a 0 based array so our maximum offset is the number of records minus 1.</p>
<p>Once you have your randum number offset its simply a matter of creating a SQL query with your offset and set size.</p>
<div style="border: 1px solid #000000;">
<p>$count = $this-&gt;Model-&gt;find('count');</p>
<p>$offset = rand(0, $count - 1);</p>
<p>$record = $this-&gt;Model-&gt;find('all', array('offset' =&gt; $offset, 'limit' =&gt; 1));</p>
</div>
<p>All done!</p> ]]> </description>
		<guid>http://www.williamlang.net/News/10-Choosing-Random-MySQL-Records</guid>
	</item>
	<item>
		<title>Unveil Updates</title>
		<link>http://www.williamlang.net/News/9-Unveil-Updates</link>
		<description><![CDATA[ <p>I'd like to let everyone know Unveil now supports Unveiling and Veiling of pages. In the coming weeks Unveil will also Unveil and Veil articles as well.</p>
<p>Covet, the wishlist application is also nearing completion so look for that in the coming days!</p> ]]> </description>
		<guid>http://www.williamlang.net/News/9-Unveil-Updates</guid>
	</item>
	<item>
		<title>Shop2Shop Shopify Application</title>
		<link>http://www.williamlang.net/News/8-Shop2Shop-Shopify-Application</link>
		<description><![CDATA[ <p><a href="http://www.twitter.com/ryanlanglois">Ryan Langlois</a> (fellow Shopify coworker) and I have developed an application called Shop2Shop.</p>
<p><strong>What is Shop2Shop?</strong></p>
<p>Shop2Shop helps Shopify store owners or theme developers migrate data from one store to another.</p>
<p><strong>How does it work?</strong></p>
<p>Shop2Shop works by creating background jobs that will move data from one store to another. Every ten minutes all jobs that Shop2Shop can handle are executed. If Shop2Shop can't complete a migration it will simply save it for next time, ensuring everything you want done, gets done.</p>
<p><br /><strong>How much does Shop2Shop cost?</strong></p>
<p><strong></strong>Currently? Not a dime.</p> ]]> </description>
		<guid>http://www.williamlang.net/News/8-Shop2Shop-Shopify-Application</guid>
	</item>
	<item>
		<title>Canada Post and ActiveShipping</title>
		<link>http://www.williamlang.net/News/7-Canada-Post-and-ActiveShipping</link>
		<description><![CDATA[ <p>I have been working on adding Canada Post as an available carrier to Active Shipping and the new version of the gem is finally available. You can download the new version of the gem or view the <a href="http://www.github.com/Shopify/active_shipping">GitHub repo</a>.</p> ]]> </description>
		<guid>http://www.williamlang.net/News/7-Canada-Post-and-ActiveShipping</guid>
	</item>
	<item>
		<title>Anatomy of a Shopify Application</title>
		<link>http://www.williamlang.net/News/6-Anatomy-of-a-Shopify-Application</link>
		<description><![CDATA[ <p>If you want a successful Shopify application (and by successful I mean store owners use it!), then it needs to be the workaround for an obstacle. If you're lucky, many store owners will want this same workaround.</p>
<p>So where do you start? <a href="http://forums.shopify.com">The Shopify forum</a>.</p>[more]<p>The developers forum has a plethora of ideas (and wants) from Shopify store owners.</p>
<p>Next, you need to choose a programming language. There are currently two official Shopify APIs. You don't have to use one of these APIs. You can develop your own (in any language you should choose).</p>
<p>The two APIs are the <a href="http://github.com/Shopify/shopify_php_api">shopify_php_api</a> (PHP) and the <a href="http://github.com/Shopify/shopify_api">shopify_api</a> (Ruby).</p>
<p>PHP is a language I have been using for over ten years.&nbsp; No matter how much better anyone ever says a language is over PHP, it will always hold top spot in <em>my</em> list of languages that I could use to develop a web application.</p>
<p>That being said, while working with Shopify these past few months, I have been learning Ruby. If Ruby is a beautiful painting then Ruby on Rails is an original Picasso.</p>
<p>[more]</p>
<p><strong>Resources</strong></p>
<p>What resources will your application be using? You'll find all the information you need in the <a href="http://api.shopify.com">API Documentation</a>.</p>
<p>Is it going to read from these resources, or will it need to write from them as well?</p>
<p>Once you've gotten this straightened out, you'll need an API Key and Secret. This is done in the Shopify Partners account. This is also where you will choose whether your application has read access or read and write access. You cannot change this at a later time! If you end up wanting to change the access your application has, you will then have to create a whole new application.</p>
<p>Your application is created, now start developing!</p>
<p><strong>Authentication</strong></p>
<p>There are a few steps to authenticate your application against a shop. First, if you don't have the shop you must prompt the merchant for their store.</p>
<p>Once you have the store you can redirect the user to the installation URL for your application.</p>
<p><em>http://somestore.myshopify.com/admin/api/auth?api_key=YOUR_API_KEY</em></p>
<p><strong>The Return URL</strong></p>
<p>Once a store owner installs your application, and every time they wish to login, they will be redirected to your application's <em>return URL</em>.</p>
<p>Appended to this URL will be four parameters.</p>
<ul>
<li>shop<br />example: somestore.myshopify.com</li>
<li>timestamp<br />example: 123456789</li>
<li>signature<br />32 character hash</li>
<li>t&nbsp;&nbsp; (token)<br />32 character hash</li>
</ul>
<p>Currently for authenticating, you will only need the shop and the token. The current APIs create a password by generating the md5 hash of the application's API Key and the authorization token.</p>
<p>All requests are then formatted with HTTP basic authentication. For instance:</p>
<p><em>http://YOUR_API_KEY:COMPUTED_PASSWORD@somestore.myshopify.com/admin/products.xml</em></p>
<p><strong>The Preferences URL</strong></p>
<p>The preferences URL is optional.</p>
<p><strong>The Support URL</strong></p>
<p>The support URL is optional.</p>
<p>Both of these URLs have the shop appended to them when clicked.</p>
<p><strong>Application Links</strong></p>
<p>Application links allow you to place a link to your application in the admin areas of the store merchants.</p>
<p>You can specify where your link should show up, an icon, and where the link should be directed to. If your link is in a top level area, say the Products Overview, only the shop URL will be appended to the URL. If you are in a specific area, like the page for a specific product, both the shop URL and the ID of the product will be appended.</p>
<p>This concludes the article on the anatomy of a Shopify Application! I hope you enjoyed it.</p> ]]> </description>
		<guid>http://www.williamlang.net/News/6-Anatomy-of-a-Shopify-Application</guid>
	</item>
	<item>
		<title>Shopify Application: Unveil</title>
		<link>http://www.williamlang.net/News/3-Shopify-Application:-Unveil</link>
		<description><![CDATA[ <div>
<p>I am proud to announce my very first Shopify application: Unveil.</p>
<p><em>Do you have a product you want to release at a certain time? Unveil will do all the legwork. Select a hidden Shopify product from your store, a date and Unveil does the rest.</em></p>
<p><strong>How does Unveil work?</strong><em><br />Unveil will search your Shopify store for products that are currently unpublished (hidden). It will then allow you to select one of these products to be unveiled at a time of your choosing!</em></p>
<p>You will find it in the&nbsp;<a title="Shopify App Store" href="http://apps.shopify.com" target="_blank">Shopify App Store</a>&nbsp;very soon!</p>
</div> ]]> </description>
		<guid>http://www.williamlang.net/News/3-Shopify-Application:-Unveil</guid>
	</item>
</channel>
</rss>
