<?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>Dev + Mocha &#187; Projects</title>
	<atom:link href="http://routecafe.com/topics/projects/feed" rel="self" type="application/rss+xml" />
	<link>http://routecafe.com</link>
	<description>It's all about David's Blog!</description>
	<lastBuildDate>Fri, 04 Jun 2010 02:59:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Events, events and more events!</title>
		<link>http://routecafe.com/posts/events-events-and-more-events.moccha</link>
		<comments>http://routecafe.com/posts/events-events-and-more-events.moccha#comments</comments>
		<pubDate>Fri, 22 Jan 2010 11:33:57 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA["might contain boring programming talk"]]></category>
		<category><![CDATA[My first important project]]></category>
		<category><![CDATA[OpenType Threads]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=221</guid>
		<description><![CDATA[After thinking, thinking, thinking and thinking. I just had to admit, it&#8217;s hard to make your web application to support (plug-ins/add-ons/modules/extensions) whatever you prefer to call it, for me they are extensions. So I had to go over and see &#8230; <a href="http://routecafe.com/posts/events-events-and-more-events.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After thinking, thinking, thinking and thinking. I just had to admit, it&#8217;s hard to make your web application to support (plug-ins/add-ons/modules/extensions) whatever you prefer to call it, for me they are extensions. So I had to go over and see some patterns and finally I came with a few ideas. It included a registry (protected one of course), and events(name) and listeners(extensions) and a handler to manage the injections.</p>
<p>I&#8217;m aware I left templates &#8220;manipulation&#8221; out, and I still won&#8217;t care for it yet. It is not the time to bother with such fancy features if I don&#8217;t have a solid extension base to work with. I&#8217;m seriously hoping to pull this one off. I want to get STARTED to code more, but I can&#8217;t code blindfolded with just ideas on mine and no blueprint to guide me, which is why I analyze, design, implement, test (you should know what I&#8217;m talking about :) ).</p>
<p>Extensions in a bulletin board is hard to see, I mean, there is so MUCH data to process. So many &#8220;events&#8221; to place, like on the one I placed &#8220;prePostLoop&#8221; which if injected, instead of calling my default model, all the raw data will be gone to your extension for you to process. Of course, you don&#8217;t have choose &#8220;prePostLoop&#8221; to just change ONE thing, there will be of course, other events to be placed.</p>
<p>Yet, a bigger problem to overcome is making the extension database layer and choosing the right database user, and also determining the extension&#8217;s &#8220;templatebits&#8221;, &#8220;routes&#8221;. It all requires a lot of &#8220;injections&#8221; to routes, doctrine (yes, I chose Doctrine ORM), views. One thing for sure is that, in the end you will have to place your function in the template. That&#8217;s a no brainer for many people, but I&#8217;m attempting to do something else.</p>
<p>To be honest, while it looks overwhelming for me. I still know I can do it if I keep my mind cool. I mean, it&#8217;s not HARD, like it was for me that I had to take a few days off after I designed how ACL (Access lists), ACL_Roles, ACL_Roles_Whitelist, ACL_Items. All I know is that the initialization of the board is going to be quite heavy.</p>
<p>To end this post, talking about events made me think of &#8220;Sections&#8221; as in &#8220;Link sections&#8221;. Where everyone want to keep it nice and neat. The problem with link sections is that I have to take care of administration pages and other things. It means, many and &#8220;Iterate&#8221; object comes to mind, such an eventful semester, I&#8217;m hoping it gives good results :) </p>
<div class='wp_likes' id='wp_likes_post-221'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(221)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://routecafe.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/events-events-and-more-events.moccha/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on security in web applications</title>
		<link>http://routecafe.com/posts/web-security-db.moccha</link>
		<comments>http://routecafe.com/posts/web-security-db.moccha#comments</comments>
		<pubDate>Tue, 19 Jan 2010 19:54:19 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=217</guid>
		<description><![CDATA[I&#8217;m pretty weary. All this week working on what/how/where/when implementations, starting with logic &#8220;what will this object hold?&#8221;. Working on the prototype of OpenType Threads has made realize how important it is to detail a plan, it&#8217;s good but also &#8230; <a href="http://routecafe.com/posts/web-security-db.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pretty weary. All this week working on what/how/where/when implementations, starting with logic &#8220;what will this object hold?&#8221;. Working on the prototype of OpenType Threads has made realize how important it is to detail a plan, it&#8217;s good but also a bit lonely hopefully when I launch the prototype I hope some developers join me along.</p>
<p>It is exciting in a way to get new concepts, and just yesterday I start to get a new one that I will immediately implement.</p>
<p>The plan is the following, probably nothing new to many seasoned programmers, but on current projects it is rarely seen, especially in PHP. We usually use a database storage, probably MySQL. MySQL provides the feature to allow multiple users to share one database, with different permissions. Quite a nice feature isn&#8217;t it? It&#8217;s hard to imagine how useful this is in programming, because well, installing PHP scripts just relies on the usual &#8220;SELECT, CREATE, INSERT, DELETE, DROP, UPDATE, ALTER&#8221;. We don&#8217;t usually THINK why MySQL users exists and many installers just tells you &#8220;Hey! Just write your database, database user, password, port if there is any and we&#8217;ll do the rest!&#8221; And that&#8217;s the worst mistake and you&#8217;ll see why:</p>
<p>I layered OpenType Threads administration concept in two, the master, the user. The master user has the following privileges :</p>
<p>Master user:</p>
<ul>
<li>INSERT</li>
<li>DELETE</li>
<li>UPDATE</li>
<li>SELECT</li>
<li>CREATE</li>
<li>ALTER</li>
<li>INDEX</li>
<li>DROP</li>
</ul>
<p>The user:</p>
<ul>
<li>SELECT</li>
<li>INSERT</li>
<li>DELETE</li>
<li>UPDATE</li>
</ul>
<p>Now, where do we usually use the &#8220;master user&#8221;? The answer lies in administration panel, imagine if you use wordpress, wordpress plug-ins usually need to CREATE/DROP/ALTER/INDEX a table, INSERT, DELETE, UPDATE, SELECT data. It&#8217;s perfect for the admin section.</p>
<p>Now why would I want to use two users, sharing the same database? The answer lies in SQL exploits. I won&#8217;t pretend this will take care of all injections, that depends mostly on your sanitation of inputs in your web application. It will certainly stop aggressive ones, like, for example:</p>
<p>- a malicious user attempts to DROP the database, everything will be lost in just one command.<br />
- One of your administrator&#8217;s &#8220;betrays&#8221; you and attempt tries to delete tables, again the DROP command will be unavailable.</p>
<p>Now as we see, using a the &#8220;normal user&#8221; will certainly be helpful. Yet it leaves kind of a gap, we can&#8217;t do much with the &#8220;DELETE&#8221; command, actually we can if you rethink your application. Lets say that in your <strong>articles table</strong> you have the usual (artID, artContent, artTitle) lets add one more column (artState(ENUM(&#8216;publish&#8217;,'delete&#8217;,'draft&#8217;))). We have enumerated three options, publish, delete and draft. The usual &#8220;publish&#8221; will just show the article to the users viewing your site.</p>
<p>Now, instead of using the DELETE command to delete the record, it will hide the record and add it to a &#8220;trash can&#8221; which will be ONLY be deleted when you access the administration panel so it carries the &#8220;master user&#8221;.</p>
<p>Issues like &#8220;what if I get my admin login stolen?&#8221;, &#8220;what if the malicious user steals the user, password of the master user?&#8221;.  Well, those issues depends on the security of your web application, it has nothing to do with the TRANSACTIONS made. And of course, sanitize all inputs.</p>
<p>I don&#8217;t believe it hurt to try this because so far it&#8217;s just another measure to take. Infact I&#8217;m not taking the measure with just using TWO MySQL users. I&#8217;m also throwing in <a href="http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html">Foreign Keys Constraints</a>, to stop any user deleting data that is related in another table. The introduction of Foreign keys constraints, it&#8217;s useful, but also can turn into a double edged blade if you overuse it.</p>
<p>Well, there is still a lot to learn :) I&#8217;m still lurking in MySQL documentation to get more ideas (but I should stop, implementing all unneeded features will just put a hole in your goal). Yet I&#8217;ll just do this one to see how it goes, it&#8217;s a gamble after all. I need to see the impact it will cause and what benefits will be gained. </p>
<div><b>2</b> people like this post.</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/web-security-db.moccha/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bing API PHP Wrapper Re-factoring</title>
		<link>http://routecafe.com/posts/bing-api-php-re-factoring.moccha</link>
		<comments>http://routecafe.com/posts/bing-api-php-re-factoring.moccha#comments</comments>
		<pubDate>Thu, 14 Jan 2010 17:13:22 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=212</guid>
		<description><![CDATA[A few months ago I released Bing API PHP to the public out of boredom, it was a hobby, still is. Now re-visiting my code I discovered a few things that needed to be introduced. Starting with an Abstract class, &#8230; <a href="http://routecafe.com/posts/bing-api-php-re-factoring.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few months ago I released Bing API PHP to the public out of boredom, it was a hobby, still is. Now re-visiting my code I discovered a few things that needed to be introduced. Starting with an Abstract class, mostly all of Bing&#8217;s XML responses are almost equal to each other. Except for some cases, yet, in the midst of working on a solution on how to &#8220;write less&#8221; and &#8220;be more efficient gathering data&#8221;. I totally forgot about abstract classes, not just totally forgot, the next version of the wrapper itself got stalled due to attempting to &#8220;write less&#8221;.</p>
<p>Why did I start re-factoring now? Good question! It had something to do with OpenType Threads, working on my prototype has taught me a lot of things about classes, design patterns and a better problem solving skill. So when I looked at my wrapper class, I said to myself &#8220;hmmm&#8230; maybe we should do this one more time&#8221;. Yet, while this is still a hobby, one of my goal of why to re-factor the code was to allow me a better manipulation with JavaScript. I know I can use XML in JavaScript but well, we&#8217;ll see how it goes :)</p>
<p>So it&#8217;s time to pay a visit to Bing&#8217;s API documentation and delete old code without thinking twice. </p>
<div><b>2</b> people like this post.</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/bing-api-php-re-factoring.moccha/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m back from the trip</title>
		<link>http://routecafe.com/posts/im-back-from-the-trip.moccha</link>
		<comments>http://routecafe.com/posts/im-back-from-the-trip.moccha#comments</comments>
		<pubDate>Sun, 02 Aug 2009 23:19:47 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=182</guid>
		<description><![CDATA[Unfortunately I didn&#8217;t had the chance to blog that I was going on a trip. My readers have dissipated to almost none but that&#8217;s okay because the readerbase will eventually grow higher than before. As for vacation, it was nice, &#8230; <a href="http://routecafe.com/posts/im-back-from-the-trip.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Unfortunately I didn&#8217;t had the chance to blog that I was going on a trip. My readers have dissipated to almost none but that&#8217;s okay because the readerbase will eventually grow higher than before. As for vacation, it was nice, quite fatigued without internet to the point of not knowing what was going on in the world. Local news aren&#8217;t great here to cover many technology news so it felt I was regressing. </p>
<p><strong>What about OpenType Threads and the BING API PHP Library?</strong> One is of course far from being released and another is around 70% done (BING PHP Lib). OpenType Threads on the other hand is begin written from the very scratch, as it is not based from any web application. OpenType Threads is a challenge to re-invent bulletin boards internally. Quite a daring and exhausting challenge because structuring each OBJECT and folder structures for future extensions and re-usability of objects; not to mention the communication between objects. </p>
<p>Vacation was the key! I&#8217;ve enjoyed it very much and I&#8217;ve finished clearing my mind. It has come with a little drawback that is coming back to write PHP it makes you feel a little lost when you leave something in the middle for a long time then come back to resume. That said, it feels joyful to get going with a clear mind and fresh energy. </p>
<p>I&#8217;ll post some photos soon! We encountered savage monkeys, a friendly horse, some cows, etc :)  </p>
<div class='wp_likes' id='wp_likes_post-182'>
<div style='display:none' class='text'><b>0</b> people like this post.</div>
<div><a href=' javascript:wp_likes.like(182)' class='like' title='like this post'>Like</a>&nbsp;<img class='loader' src='http://routecafe.com/wp-content/plugins/wp-likes/images/spinner.gif' alt=''/></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/im-back-from-the-trip.moccha/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenType Threads, new project</title>
		<link>http://routecafe.com/posts/opentype-threads-new-project.moccha</link>
		<comments>http://routecafe.com/posts/opentype-threads-new-project.moccha#comments</comments>
		<pubDate>Wed, 08 Jul 2009 00:48:37 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=152</guid>
		<description><![CDATA[Today I&#8217;ll be announcing the start of a new project called &#8220;OpenType Threads&#8221;. OpenType Threads is a Bulletin Board System (a.k.a Forum, Discussion Board, Message Board), now don&#8217;t shake your head yet! It&#8217;s not yet another message board that will &#8230; <a href="http://routecafe.com/posts/opentype-threads-new-project.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ll be announcing the start of a new project called &#8220;OpenType Threads&#8221;. OpenType Threads is a Bulletin Board System (a.k.a Forum, Discussion Board, Message Board), now don&#8217;t shake your head yet! It&#8217;s not yet another message board that will add tons of bloated things (A.K.A Smarty, Template Engines, really guys? We do not need template engines, they just eat up the ram of the poor server from so many regex, splitting </imho>). Of course that is up to you to decide :) </p>
<p>The purpose of my project is to provide rich flexibility to developers and users. </p>
<p>- <strong>MVC Design</strong> (Model-View-Controller): The application itself is a framework, yet I must warn you that it is not a framework. The choice of the MVC design is to eliminate the use of template engines. I believe PHP is not a tough language to learn, so please web designers, learn the basics. </p>
<p>So, is it really a framework or not? Hard to say buddy! It feels like one, but it&#8217;s not one. </p>
<p>- <strong>URL Routing</strong>: Oh so glorious clean urls (a.k.a pretty urls, friendly urls). This is what makes it feel a framework. OpenType Threads provides the option to create new routes: Regular Expression routes, Static, Route. So! When a developer creates an extension, they don&#8217;t need to bother with links at all. This is certainly a must-mention. OpenType Threads does not attempts to be a framework, but a solution. Sure, you can create portals with it, probably. <strong>It will be always a message board</strong>, no buts. </p>
<p>- <strong>Database</strong>: Wait? I&#8217;m going to be discussing about database? Naw! I&#8217;ll be using <a href="http://doctrine-project.org">Doctrine ORM </a>to be the main layer to manage the database. Why? </p>
<ol>
<li>You can use Oracle, Firebird, Microsoft SQL Server, etc. Through PDO</li>
<li>Prevention of SQL Injections</li>
<li>Creation of multiple connections (which is very useful if I want to import, lets say&#8230; phpBB, IceBB)</li>
</ol>
<p>- <strong>Re-usability</strong>: OpenType Threads tries it hardest to become independent of some objects. That means that if I use a e-mail validation filter, you can also use it painlessly for your extensions.<br />
- <strong>Extensions</strong>: This is the toughest part, there are design patterns that will probably help. Yet I don&#8217;t want to create a system that will overkill the server. There are many things that happens in a bulletin board, INTERNALLY. And really, I don&#8217;t want it to be a wordpress, because it may be pretty externally, but internally it&#8217;s one ugly thing to maintain. (really, how can they keep their sanity!) </p>
<p>- <strong>License</strong>: This product is under <strong>a proprietary license.</strong> See why later on :)  </p>
<p>Anyway that should give you an idea of this web application. I know there are frameworks out there I could have based my application on. It is not because I feel like &#8220;but man I hate learning other systems, I prefer writing my own!&#8221; or &#8220;php frameworks are so over-engineered&#8221;. I have been using PHP for years, on my way learning Java. See, this project is not a popularity contest. This is me wanting to learn more about design patterns, this is me becoming a better php developer, and this is me providing my knowledge to users. </p>
<p>What can I say? Don&#8217;t expect things to come to you. Go for it, life is a bitch, and while it sounds unprofessional, it&#8217;s a tough one! <strong>I&#8217;ve been hesitant for quite a long time in starting a project</strong>, always <strong>thinking the negative sides</strong> of creating one. Take joy in what you create, take joy in what you can vision. Don&#8217;t worry about &#8220;what if people don&#8217;t like it&#8221; , &#8220;what if my creation sucks&#8221;, &#8220;what if I won&#8217;t be able to support others&#8221;, &#8220;there are other alternatives&#8221;. Really, don&#8217;t worry, be happy. <strong>Part of the learning process is that sometimes you learn with others.  </strong></p>
<p>About the &#8220;there are other alternatives&#8221;. And you know what? sometimes they stick with the same features for years, same look, same logic. No <a href="http://en.wikipedia.org/wiki/Code_refactoring">re-factoring</a>, no features. A product that has an standard set of features DOES NOT limit you to be creative. I can think of a dozen ways how a message board should act, how can it look. Really, take joy in what you can create and envision. </p>
<p>Another personal thought: I started this project because <strong>I can&#8217;t stand the solutions out there</strong>. I will not name any of them because if I do I will sound more like a person with anger management problems.</p>
<p>A few more things about the project: <strong>What about Polls</strong>, <strong>private message system</strong>, etc etc? Hey guys, I&#8217;m only one person. I take action with present needs. I don&#8217;t want to go create something half done then jump onto the other. The world will not end! So, baby steps, we&#8217;ll get there :) </p>
<p>Oh yea, about the proprietary license, no no, the project will be licensed under the <strong>Lesser General Public License</strong> (LGPL)</p>
<p>I know some companies will love me for choosing the LGPL, don&#8217;t worry, the love is equal. And guys, OpenType Threads is PHP Powered!  </p>
<div><b>2</b> people like this post.</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/opentype-threads-new-project.moccha/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get more writing less</title>
		<link>http://routecafe.com/posts/get-more-writing-less.moccha</link>
		<comments>http://routecafe.com/posts/get-more-writing-less.moccha#comments</comments>
		<pubDate>Mon, 08 Jun 2009 20:14:25 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=101</guid>
		<description><![CDATA[Truthfully, there is a 99.9% that SimpleXML will be used to be the main support of the Bing API PHP. Of course, if you have seen some of the first examples to get a result you must enter various nodes &#8230; <a href="http://routecafe.com/posts/get-more-writing-less.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Truthfully, there is a 99.9% that SimpleXML will be used to be the main support of the Bing API PHP. Of course, if you have seen some of  the first examples to get a result you must enter various nodes and that&#8217;s quite troublesome. So my current goal is to reduce the code and get what you want writing less. </p>
<p>How! I&#8217;m introducing a new class called <code>ResultSet_Manager</code> which will take the decisions on which class to use (pretty much like factory pattern but not quite since it doesn&#8217;t follow some of the standards). The Manager can be turned on optionally to maintain an independance and if it&#8217;s on it will call the classes starting with <code>ResultSet_SourceType_(SourceType)</code>. Let&#8217;s take a look at how it would work:</p>
<pre class="brush: php">
    // // Notes: Spell query must be urlencode, REQUIRED
    $search-&gt;query(&#039;which+is+better+tweetdeck+or+seesmic&#039;)
           -&gt;setSources(&#039;Web&#039;)
           -&gt;setFormat(&#039;xml&#039;)
           -&gt;setResultManager(TRUE); # Required to be boolean

    // Contains the search
    $results = $search-&gt;getResults();
   echo $results-&gt;Total;
   echo $results-&gt;Get-&gt;WebResult[1]-&gt;Title;
   echo $results-&gt;QueriedTerm;
</pre>
<p>As you see, it is slightly shorter than the previous:</p>
<pre class="brush: php">
$ThumbURL = $ImageResultSet-&gt;Image-&gt;Results-&gt;ImageResult[$i]-&gt;Thumbnail[0]-&gt;Url;
$ThumbWidth = $ImageResultSet-&gt;Image-&gt;Results-&gt;ImageResult[$i]-&gt;Thumbnail[0]-&gt;Width;
$ThumbHeight = $ImageResultSet-&gt;Image-&gt;Results-&gt;ImageResult[$i]-&gt;Thumbnail[0]-&gt;Height;
$ThumbSite = $ImageResultSet-&gt;Image-&gt;Results-&gt;ImageResult[$i]-&gt;Url;
</pre>
<p>Now you notice quite a difference, although it&#8217;s not the same query we originally ran you should see that the code has been reduced. </p>
<p>While the goal to make everything more simple remains a priority. The ResultSet Manager and the SourceType classes (e.g ResultSet_SourceType_Web) are independant of Bing API PHP. Meaning that you can use it without calling Bing API PHP. </p>
<p>For example (example has not been tested in dev environment):</p>
<pre class="brush: php">
&lt;?php
$XML = file_get_contents(&#039;http://api.search.live.net/xml.aspx?AppId=APPID&amp;Query=Guitars&amp;Sources=Image&#039;);
require_once &#039;SourcesManager/ResultSet_SourceType_Image&#039;;
$ImageSet = new ResultSet_SourceType_Image($XML);
$ImageSet-&gt;Get-&gt;ImageResult[1]-&gt;Title;
?&gt;
</pre>
<p>All SourceTypes classes have and property called &#8220;Get&#8221; which holds the Result. In Multiple sources, while not yet developed. My other idea is to do something nearing to:</p>
<pre class="brush: php">
$MultipleSets-&gt;Get-&gt;ImageResult[1]-&gt;Title;
$MultipleSets-&gt;Get-&gt;WebResult[1]-&gt;Title;
$MultipleSets-&gt;Get-&gt;VideoResult[1]-&gt;Title;
</pre>
<p>Anyway! The next version will provide a experimental support of SOAP. That&#8217;s about it for today, see you next time.
 </p>
<div><b>2</b> people like this post.</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/get-more-writing-less.moccha/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bing API PHP v1.1 Release</title>
		<link>http://routecafe.com/posts/bing-api-php-v11-release.moccha</link>
		<comments>http://routecafe.com/posts/bing-api-php-v11-release.moccha#comments</comments>
		<pubDate>Sat, 06 Jun 2009 02:31:12 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=84</guid>
		<description><![CDATA[It&#8217;s been a great day! And if your day wasn&#8217;t good, I&#8217;d hope this make your day. Today I&#8217;m happy to announce release of Bing API PHP. The first version really helped a lot didn&#8217;t it? This version helps you &#8230; <a href="http://routecafe.com/posts/bing-api-php-v11-release.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a great day! And if your day wasn&#8217;t good, I&#8217;d hope this make your day. Today I&#8217;m happy to announce release of Bing API PHP. The first version really helped a lot didn&#8217;t it? This version helps you even more, now introducing <code>setHighlightFormat($start, $end, $sources)</code>. If <code>EnableHighlighting</code> is enabled on your query and you use this function it will automatically format the highlighted word with your desired html element (e.g.: div, span, p). Here&#8217;s the list of changes</p>
<p>- Removed urlencode from the library, you <strong>must</strong> use urlencode when querying since it won&#8217;t do it automatically</p>
<p>- Removed <code>setProxy</code> and added something more flexible, that is <code>setCurlArray(array())</code>, check the php.net manual on what to put in the array.</p>
<p>- Added <code>setHighlightFormat()</code> as I explained before this helpful function will aid you with bing.com&#8217;s highlight unicode chars (U+E000 and U+E001)</p>
<p>- Another addition is <code>getRequestedQueryURL</code>. This is something I needed most when I was querying the server, this will return you something similar to this: <code>http://api.search.live.net/xml.aspx?AppId=YOUR APP ID&#038;Query=da&#038;Sources=Image&#038;Image.Count=20&#038;Image.Offset=0&#038;Image.Filters=Size:Small&#038;Adult=Moderate&#038;Options=EnableHighlighting</code></p>
<p>- Now another function is resetHighlight($source), bing.com returns your search with extra characters in the title, this will help you remove them. Optional function. </p>
<p><a href="http://routecafe.com/bingapiphp-1.1.zip">Download Now</a> | <a href="http://msdn.microsoft.com/en-us/library/dd251056.aspx">Check Bing API Documentation</a> | <a href="http://www.bing.com/developers/">Developers API Key</a></p>
<p>After this post, there is a next one coming in a few hours showing examples of this library and SimpleXML and more.  </p>
<div><b>4</b> people like this post.</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/bing-api-php-v11-release.moccha/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>BING PHP API fixes</title>
		<link>http://routecafe.com/posts/bing-php-api-fixes.moccha</link>
		<comments>http://routecafe.com/posts/bing-php-api-fixes.moccha#comments</comments>
		<pubDate>Thu, 04 Jun 2009 13:45:30 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=80</guid>
		<description><![CDATA[Right, it seems when I woke up, ate breakfast, and sat down to continue playing with bing&#8217;s api I loaded my SimpleXML and BOOM! I was having a few errors already. Here is the following fixes of the library - &#8230; <a href="http://routecafe.com/posts/bing-php-api-fixes.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Right, it seems when I woke up, ate breakfast, and sat down to continue playing with bing&#8217;s api I loaded my SimpleXML and BOOM! I was having a few errors already. </p>
<p>Here is the following fixes of the library<br />
<strong>- URL Encode added<br />
- cURL RETURN TRANSFER added </strong></p>
<p>Now it&#8217;s very stable, yet I want to point out the following things: </p>
<p>According to one of the Microsoft&#8217;s BING API developer. <strong>PHP SOAP is currently having problems with Bing API Service</strong>. I haven&#8217;t tried it out because I&#8217;m still working on the implementation. </p>
<p><a href="http://routecafe.com/posts/bing-api-php.moccha">Download the newest fix</a> | <a href="http://routecafe.com/posts/bing-api-php.moccha">Examples</a>  </p>
<div><b>3</b> people like this post.</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/bing-php-api-fixes.moccha/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bing API PHP</title>
		<link>http://routecafe.com/posts/bing-api-php.moccha</link>
		<comments>http://routecafe.com/posts/bing-api-php.moccha#comments</comments>
		<pubDate>Wed, 03 Jun 2009 23:43:01 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://routecafe.com/?p=70</guid>
		<description><![CDATA[Get the new updates at the project homepage in codeplex. Well, since the opening of bing.com I&#8217;ve been playing with the API and some of the options it provides. Certainly I was getting annoyed since I had to rebuild each &#8230; <a href="http://routecafe.com/posts/bing-api-php.moccha">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="highlight">
<h1><a href="http://bingapiphp.codeplex.com/">Get the new updates</a> at the project homepage in codeplex.</h1>
</div>
<p>Well, since the opening of <a href="http://bing.com">bing.com</a> I&#8217;ve been playing with the API and some of the options it provides. Certainly I was getting annoyed since I had to rebuild each of my queries if I wanted something so I search for a library that could do this for me which I couldn&#8217;t find and I ended up writing my own. </p>
<p><strong>Requirements</strong>: <strong>PHP5</strong> and <strong>cURL</strong></p>
<p>How to use this API? Here is a simple demonstration</p>
<pre class="brush: php">

// Include the Bing API PHP Library
require_once &#039;library/BingAPI.php&#039;;

// Simply start the class with your AppID argumented
$search = new BingAPI(&#039;YOUR APPID KEY&#039;);

// Build your query easily
/* To use multiple resources simply do -&gt;setSources(&#039;Web+Image&#039;) ,
   it must match the source type
   bling.com provides */
$search-&gt;query(&#039;gimp&#039;)
       -&gt;setSources(&#039;Web&#039;)
       -&gt;setFormat(&#039;xml&#039;) /* Also you can try: xml, soap or json */
       -&gt;setOptions(
             array(
                  &#039;Web.Count&#039; =&gt; &#039;10&#039;,
                  &#039;Web.Offset&#039; =&gt; &#039;0&#039;,
                  &#039;Adult&#039; =&gt; &#039;Moderate&#039;,
                  &#039;Options&#039; =&gt; &#039;EnableHighlighting&#039;)
    );
/* Check the API documentation in bing.com for more information */

/* This will give you a raw output */
echo $search&gt;getResults();
</pre>
<p>I&#8217;d hope this little library makes your life easier :) Soon there&#8217;ll be a tracker if there are problems with it or you can comment here. </p>
<p><a href="http://bingapiphp.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28368">Download it now</a> | <a href="http://msdn.microsoft.com/en-us/library/dd251056.aspx">Check the documentation</a> | <a href="http://www.bing.com/developers/">Get a Developer API Key</a></p>
<p><del datetime="2009-06-04T01:05:21+00:00"><strong>Heads up:</strong> There will be soon a better way to issue bugs </del></p>
<p>Any issues: <a href="http://bingapiphp.codeplex.com/WorkItem/List.aspx">http://bingapiphp.codeplex.com/WorkItem/List.aspx</a><br />
<a href="http://bingapiphp.codeplex.com/">Project Homepage</a></p>
<h3 class="h3style">About SOAP Implementation</h3>
<p>It seems I have made silly mistake with SOAP, there is actually no current SOAP implementation and it will be supplied soon.  </p>
<div><b>12</b> people like this post.</div>
]]></content:encoded>
			<wfw:commentRss>http://routecafe.com/posts/bing-api-php.moccha/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
