<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CodeSanity &#187; evanto</title>
	<atom:link href="http://codesanity.net/tag/evanto/feed/" rel="self" type="application/rss+xml" />
	<link>http://codesanity.net</link>
	<description>PHP, Javascript &#38; Technology Ramblings</description>
	<lastBuildDate>Wed, 07 Jul 2010 00:28:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Envato Marketplace API with CodeIgniter</title>
		<link>http://codesanity.net/2009/04/evanto-marketplace-api-codeigniter/</link>
		<comments>http://codesanity.net/2009/04/evanto-marketplace-api-codeigniter/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 04:32:45 +0000</pubDate>
		<dc:creator>Tom Schlick</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[evanto]]></category>

		<guid isPermaLink="false">http://codesanity.net/?p=23</guid>
		<description><![CDATA[Envato recently released an API for thier various Marketplaces. I have taken the various methods of interacting with this data and compiled it into one, easy to use codeigniter library. It can also be used as a standalone php class if you wish. The class is currently PHP5 and requires you have json_encode, json_decode, and curl functions available.]]></description>
			<content:encoded><![CDATA[<h1>Overview</h1>
<p>So I created this library mostly out of boredom. It includes functions to interact with all of the options &amp; functionality that the current version (&#8220;EDGE&#8221;) provides. It was designed to be a CodeIgniter library but it can easily be ported over to php in just a few steps. It allows you to output the data in json, array, or raw (the format that the request was [json, xml]). So lets get to it!</p>
<h1>Download</h1>
<p>[download id="1"]</p>
<h1>Documentation</h1>
<h2 style="padding-left: 30px;">Configuration</h2>
<p style="padding-left: 30px;">There are several options you can set in the configuration that will make the library behave differently.</p>
<ul>
<li>username &#8211; obviously your username for the envato marketplaces</li>
<li>api_key &#8211; your api key for the marketplaces ( you should never set this in view of the public, its sort of like a password ).</li>
<li>api_format &#8211; the format you want the library to request, this can be altered with the next option (output format) &#8211; options incude : json, array, xml (default is json)</li>
<li>output_format &#8211; the format you want the library to return to you. options: array (default), json, raw (unaltered/formatted data straight from the feed) note: to get xml format back you need to set this to raw and set api_format to xml</li>
</ul>
<p style="padding-left: 30px;">This is how you can set the config information with a simple function and array.<br />
[code language='php']<br />
$this->envato_api->config(array('api_format' => 'json', 'output_format' => 'array', 'username' => 'joesmith', 'api_key' => 'MYSUPERSECRETKEY'));<br />
[/code]
</p>
<p style="padding-left: 30px;">Place the configuration code above the functions listed below.</p>
<h2 style="padding-left: 30px;">Public Functions</h2>
<p style="padding-left: 30px;">These are functions that do not require a username and api key to access. They are mostly things such as the latest files on the marketplaces, the most popular threads, etc.</p>
<p style="padding-left: 30px;">
<h3 style="padding-left: 30px;">Blog Posts</h3>
<p style="padding-left: 30px;">A list of blog posts for a particular site. Requires a site parameter.</p>
<p>[code language='php']<br />
$data = $this->envato_api->public_blog_posts('sitename');<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">Active Threads</h3>
<p style="padding-left: 30px;">Threads with the most recent messages activity. Requires a site parameter.</p>
<p>[code language='php']<br />
$data = $this->envato_api->public_threads_active('sitename');<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">Number of Files in Categories</h3>
<p style="padding-left: 30px;">Shows the number of files in the major categories of a particular site. Requires a site paramater.</p>
<p>[code language='php']<br />
$data = $this->envato_api->public_files_number('sitename');<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">Category New Files</h3>
<p style="padding-left: 30px;">New files, recently uploaded to a particular site. Requires site and category paramaters.</p>
<p>[code language='php']<br />
$data = $this->envato_api->public_files_new('sitename', 'categoryname');<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">Popular Files</h3>
<p style="padding-left: 30px;">Returns the popular files for a particular site. Requires a site paramater.</p>
<p>[code language='php']<br />
$data = $this->envato_api->public_files_popular('sitename');<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">New User Files</h3>
<p style="padding-left: 30px;">Shows the newest 10 files a user has uploaded to a particualr site. Requires username and site paramaters.</p>
<p>[code language='php']<br />
$data = $this->envato_api->public_files_user_new('username', 'sitename');<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">Random New Files</h3>
<p style="padding-left: 30px;">Shows a random list of newly uploaded files from a particular site (i.e. like the homepage). Requires a site paramater.</p>
<p>[code language='php']<br />
$data = $this->envato_api->public_files_new_random('sitename');<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">API Releases</h3>
<p style="padding-left: 30px;">Returns Release and Set information for the API (used to generate the documentation).</p>
<p>[code language='php']<br />
$data = $this->envato_api->public_releases();<br />
$this->evanto_api->clear();<br />
[/code]</p>
<p style="padding-left: 30px;">
<h2 style="padding-left: 30px;">Private User Functions</h2>
<p style="padding-left: 30px;">These are functions that DO require a username and API key to access. They include things such as account information, billing statements, etc. <strong>Make sure to set your username &amp; api key inside the script or with the config function above.</strong></p>
<p style="padding-left: 30px;">
<h3 style="padding-left: 30px;">User Vitals</h3>
<p style="padding-left: 30px;">Return a users username and balance.</p>
<p>[code language='php']<br />
$data = $this->envato_api->user_vitals();<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">User Account</h3>
<p style="padding-left: 30px;">Returns the first name, surname, total earnings, total deposits, balance (deposits + earnings), country and current commission rate for sales.</p>
<p>[code language='php']<br />
$data = $this->envato_api->user_account();<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">User Earnings &amp; Monthly Sales</h3>
<p style="padding-left: 30px;">Returns the monthly sales data, as displayed on the user&#8217;s earnings page.</p>
<p>[code language='php']<br />
$data = $this->envato_api->user_earnings();<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">User Statement</h3>
<p style="padding-left: 30px;">Returns the last 100 events as seen on the user&#8217;s statement page.</p>
<p>[code language='php']<br />
$data = $this->envato_api->user_statement();<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">User Recent Sales</h3>
<p style="padding-left: 30px;">Shows the 50 recent sales of the user&#8217;s items.</p>
<p>[code language='php']<br />
$data = $this->envato_api->user_recent_sales();<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h3 style="padding-left: 30px;">User Multiple</h3>
<p style="padding-left: 30px;">This function will return multiple sets of data at once. if you dont supply anything in the parameters it will return all of the results by default. The options inside the array below are the only options you have. You can use as many or as little as you need.</p>
<p>[code language='php']<br />
$data = $this->envato_api->user_multiple(array('account', 'vitals', 'earnings-adn-sales-by-month', 'statement', 'recent-sales'));<br />
$this->evanto_api->clear();<br />
[/code]</p>
<h2>Done!</h2>
<p>We are all done! If you have any questions, suggestions, bugs or just wanna say thanks then reply in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://codesanity.net/2009/04/evanto-marketplace-api-codeigniter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Content Delivery Network via Amazon Web Services: S3: assets.codesanity.net.s3.amazonaws.com

Served from: codesanity.net @ 2010-09-06 07:47:32 -->