<?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>Exosus</title>
	<atom:link href="http://www.exosus.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.exosus.com</link>
	<description>Affiliate marketing through any means possible.</description>
	<lastBuildDate>Tue, 31 Aug 2010 21:49:18 +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>The downfall of phone verification</title>
		<link>http://www.exosus.com/?p=265</link>
		<comments>http://www.exosus.com/?p=265#comments</comments>
		<pubDate>Tue, 31 Aug 2010 21:48:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=265</guid>
		<description><![CDATA[Phone verification works against spammers on most sites because of one thing. It&#8217;s currently too expensive to buy phone numbers to verify accounts to make spamming worthwhile. Now that Gmail, Facebook, and Craigslist are all starting to use phone verification as a means of preventing spam not only are they turning away legitimate users who [...]]]></description>
			<content:encoded><![CDATA[<p>Phone verification works against spammers on most sites because of one thing. It&#8217;s currently too expensive to buy phone numbers to verify accounts to make spamming worthwhile. Now that Gmail, Facebook, and Craigslist are all starting to use phone verification as a means of preventing spam not only are they turning away legitimate users who don&#8217;t own a cellphone or landline but they&#8217;re actually making it more cost effective for spammers. A phone number to a spammer might cost a $1 from Twilio. Well a $1 per verified Gmail account is rather expensive, but throw in the fact you can now make accounts for Facebook and Craigslist (although technically Twilio numbers won&#8217;t work on craigslist because they&#8217;re marked as VOIP), the actual cost of an account goes down to roughly 33 cents. Include a couple more sites whom I&#8217;m sure will take up phone verification in the future, and that cost goes down even further. The more sites that start using phone verification will be the down fall of phone verification. Just my two cents. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=265</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiring through ODesk, Scriptlance, and Elance</title>
		<link>http://www.exosus.com/?p=261</link>
		<comments>http://www.exosus.com/?p=261#comments</comments>
		<pubDate>Mon, 09 Aug 2010 18:54:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=261</guid>
		<description><![CDATA[I&#8217;ve been doing some freelance work just to keep my PHP skills up-to-date. Here are some tips to get great freelancers and great work. 1) It is so frustrating but I see this every day. People put in their job descriptions, &#8220;I don&#8217;t want to pay more than $50&#8243;, or &#8220;I am looking for the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some freelance work just to keep my PHP skills up-to-date. </p>
<p>Here are some tips to get great freelancers and great work.</p>
<p>1)  It is so frustrating but I see this every day. People put in their job descriptions, &#8220;I don&#8217;t want to pay more than $50&#8243;, or &#8220;I am looking for the lowest bid&#8221;. What this says is you&#8217;re a cheap ass who wants a lot of work for very little money. I never bid on these projects because immediately I can tell the person wants a really good job for practically free. The only people who do bid on these projects are very inexperienced people from 3rd world countries. The code you end up receiving will suck I can almost guarantee it.</p>
<p>2) If you&#8217;re going to post a project, make the budget higher than you actually intend to pay. It&#8217;ll draw more attention to your project and get better coders bidding on it. They may bid higher than the budget you had in mind but you might find someone who can do the job really well and is worth the extra money, or you can always negotiate with them privately to get the bid down to a budget you can agree with.</p>
<p>3) If you plan to pay per hour, remember there is something in the programming world called a 10X Coder. 10X means they can develop code 10X faster than someone with less experience. So just because the bid may be for $40 an hour against someone charging $10 an hour, it does not necessarily mean the $10 an hour person is going to end up being cheaper, and most likely the code won&#8217;t end up being better.</p>
<p>4) If you plan to pay per hour on something like Odesk, have the person estimate the exact amount of time it&#8217;ll take to get the project done. If they say 3 hours, set their max hours at 3. Also, negotiate with them saying if they go over the 3 hours, the price per hour drops 50%, or something along those lines. Coders will draw a project out when you&#8217;re paying per hour because as long as their is movement on their computer screen they get paid. If they have 4 hours, they&#8217;ll try to use all of it because it&#8217;s money in the bank.</p>
<p>5) Have faith in people with little or no ratings yet on freelance sites. I&#8217;ve had some very good experiences hiring people with no feedback simply because they wanted good initial feedback and were willing to go the extra mile to make sure that happened. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=261</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PPV, my experiences</title>
		<link>http://www.exosus.com/?p=253</link>
		<comments>http://www.exosus.com/?p=253#comments</comments>
		<pubDate>Wed, 12 May 2010 19:26:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=253</guid>
		<description><![CDATA[I&#8217;m one of those people that can&#8217;t stand PPV. I stopped doing it long before the hype came about. I think the traffic quality is a complete joke, long term sustainability is impossible because you&#8217;re advertising the same product to almost the same set of users every day, and lastly the competition is now fierce [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m one of those people that can&#8217;t stand PPV. I stopped doing it long before the hype came about. I think the traffic quality is a complete joke, long term sustainability is impossible because you&#8217;re advertising the same product to almost the same set of users every day, and lastly the competition is now fierce because every blogger is talking about it. If you&#8217;re a newb, don&#8217;t touch PPV, you&#8217;ll go through a decent size ad budget in literally 30 seconds, drop your ad server even faster than that, and lose a ton of money! With that said, here&#8217;s what I learned about PPV when I did it, and maybe this can help some of you that are still interested in doing it.</p>
<p>1) For the best results, create a landing page that looks similar to your target site to convert the user. You&#8217;ll essentially trick them into thinking your site is the site they were looking for and they&#8217;ll dish out a lot of information. It&#8217;s sort of like legal phishing. This will skyrocket conversions but also lower quality quite a bit so it&#8217;s not perfect for every product. Either way, I did have a lot of success doing this.</p>
<p>2) I can&#8217;t recommend rackspace.com&#8217;s cloudsites enough. I thought my servers were good until I realized I could send thousands of impressions a second to them with PPV traffic instantly dropping them and spending $100s sending traffic to a down site. With that said, I moved all my PPV landing pages to cloudsites on the cheap and haven&#8217;t been happier. In fact, I use cloudsites for most of my static landing pages now.</p>
<p>3) Remember the pros have automated much of PPV, which means people are using programs to auto adjust their bids to out bid you by a penny on every target. If you raise your bid, I can guarantee you any legitimate competition will be automatically raising that bid higher than yours within the next hour. If you&#8217;re running manually this is going to cause you a complete headache. With that said it usually doesn&#8217;t matter too much to be in the second or third spot providing your competition isn&#8217;t advertising the same product. I did research on this awhile back looking at the conversion statistics of a 2nd view of my product compared to a first but I can&#8217;t remember the results at the moment. I&#8217;m fairly certain first views converted much higher. If you decide to do your own research let me know what you find.</p>
<p>4) Cloaking is used quite a bit by the bigger PPV guys to add sound to their landing pages and beat the landing page approval process. This does increase conversions although it&#8217;s generally against any PPV network&#8217;s TOS so be careful. </p>
<p>5) Finding a white label offer and creating it to look like the target site is a winner.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=253</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toorcon 11 in San Diego (A review)</title>
		<link>http://www.exosus.com/?p=249</link>
		<comments>http://www.exosus.com/?p=249#comments</comments>
		<pubDate>Fri, 30 Oct 2009 10:06:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=249</guid>
		<description><![CDATA[Last weekend I was at Toorcon 11 in San Diego mostly because of my interest in botnets and malware. Just some brief cliff notes from the conference I thought were semi-interesting: Koobface is absolutely the coolest virus/trojan ever. Whatever dev team is maintaining that project is genius. For instance, to create accounts they&#8217;ll download a [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend I was at <a href="http://sandiego.toorcon.org">Toorcon 11 in San Diego</a> mostly because of my interest in botnets and malware.  Just some brief cliff notes from the conference I thought were semi-interesting:</p>
<p>Koobface is absolutely the coolest virus/trojan ever. Whatever dev team is maintaining that project is genius. For instance, to create accounts they&#8217;ll download a captcha from one infected user, show it to another infected user telling them they need to type it in to continue using their computer, and then they&#8217;ll take that response and send it back over to the first infected user to create an account. </p>
<p>Another hilarious thing is a guy by the name of Dancho Danchev has been doing research on koobface, and they mess with him all the time. For instance, they redirected facebook&#8217;s IP space to his <a href="http://ddanchev.blogspot.com/">blog</a>.</p>
<p>Lastly, koobface spoofs as a Flash updater to get people to install it. Pretty interesting way to get someone to download something. It&#8217;s something I&#8217;d even fall for probably.</p>
<p>A little bit on Malware installs was discussed along with some interesting tools.</p>
<p><a href="http://www.sorn-soft.com/">SDDownloader</a> is software you manage to get installed on a users machine and it allows you to install more software (aka payperinstall toolbars) with it. </p>
<p>Although not new:<br />
<a href="http://www.virustotal.com">VirusTotal</a> &#8211; does full virus scans on anything you upload to it via a bunch of commercial and free virus scanners.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=249</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iMacros Firefox wrapped with PHP, Linux, VirtualBox</title>
		<link>http://www.exosus.com/?p=218</link>
		<comments>http://www.exosus.com/?p=218#comments</comments>
		<pubDate>Fri, 30 Oct 2009 08:29:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[My Terrible Coding]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=218</guid>
		<description><![CDATA[NOTE: Please please please feel free to leave comments criticizing anything I write here or if you have any questions! If it can help me learn to do something better I&#8217;m all for it. So, as much as I love using PHP and CURL, I&#8217;ve finally graduated to none other than iMacros because a majority [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE: Please please please feel free to leave comments criticizing anything I write here or if you have any questions! If it can help me learn to do something better I&#8217;m all for it.</strong></p>
<p>So, as much as I love using PHP and CURL, I&#8217;ve finally graduated to none other than <a href="http://www.iopus.com/">iMacros </a>because a majority of my bigger projects have started to require me to read pages which contain necessary javascript to view. Reverse engineering javascript is fun, when it works, but wasting valuable time reversing it doesn&#8217;t make sense.</p>
<p>If you haven&#8217;t heard of iMacros it&#8217;s a super powerful macro scripting program made specifically to automate web browser sessions. Now before you start thinking to yourself macros are for newbs who don&#8217;t know how to code, trust me this is far from newb. iMacros on its own is very newb, mixing iMacros + PHP/MySQL + other scripting = insanely complex.</p>
<p><strong>My setup is this:</strong></p>
<p><a href="http://fedoraproject.org/">Fedora Core 11</a> w/ <a href="http://www.virtualbox.org/">VirtualBox</a> installed (a free VMware type application), and a WinXP Pro Virtual Machine w/<a href="http://www.iopus.com/"> iMacros scripting edition</a> installed along with the <a href="https://addons.mozilla.org/en-US/firefox/addon/3863">iMacros Firefox Plug-in</a>.</p>
<p>The reasoning behind running Linux and a virtual machine is this, if a WinXP virtual machine starts leaking memory/freezes/dies, I can simply close the virtual machine and reopen it via Linux command line. I&#8217;m an avid fan of making sure stuff can run unattended for months. Although it makes things a bit more complex, it&#8217;s well worth the time investment in doing it right.</p>
<p>With that said, I plan to slowly add my entire setup to this post, along with some more complex coding that will allow you to multi-thread iMacros sessions.</p>
<p><strong>iMacros + Firefox Plugin</strong><br />
The reasoning behind using the iMacros Firefox Plug-in versus the iMacros Browser is that the current iMacros browser doesn&#8217;t support threaded sessions. What this means is that the same  cookies, cache, proxy settings will be used across every iMacros browser session. This is no good if you want to log in to 2 different accounts at once using 2 different proxy IPs. Firefox however allows you to create different browser profiles (just run &#8216;firefox -ProfileManager&#8217; with firefox already closed to view the profile manager), and iMacros allows you to choose different profiles during Firefox&#8217;s execution. As a result you get browser sessions that are entirely different from one another.</p>
<p><strong>Setting up WAMPServer.</strong></p>
<p><strong>1) Download and install WAMP Server at </strong><a href="http://www.wampserver.com/">http://www.wampserver.com/</a></p>
<p><strong>2) Setup the command PHP to execute the WAMP server version of PHP.</strong> You won&#8217;t need Apache, I just like WampServers version of the php config which already has most of the plugins I need installed which saves a lot of headache. To make the PHP command work on Windows Vista click the start button, right click Computer and go to Properties. Click advanced system settings, go to the Advanced tab, click environment variables at the bottom, under System Variables go to the variable PATH and add the PATH to the folder that contains the php.exe (my path is: &#8216;C:\wamp\bin\php\php5.3.0&#8242;;)</p>
<p><strong>Setting up Firefox &#8211; </strong></p>
<p>First off you&#8217;re going to need to download the <a href="https://addons.mozilla.org/en-US/firefox/addon/3863">Firefox version of iMacros here.</a><strong><br />
</strong></p>
<p>To make Firefox and iMacros run most efficiently I highly recommend you do several things.</p>
<p><strong>1) Disable Flash</strong> &#8211; iMacros seems to have page loading issues when Flash is involved. Since you can&#8217;t play with flash in the iMacros Firefox Plug-in anyway, lets disable flash by going to Tools/Add-ons clicking the &#8220;Plugins&#8221; tab and going down to &#8216;Shockwave Flash&#8217; and disabling it.</p>
<p><strong>2) Install <a href="https://addons.mozilla.org/en-US/firefox/addon/1865">AdBlock Plus </a> </strong>- why spend bandwidth and CPU processes running ads you&#8217;ll never see as well as get advertisers charged for those ads. Secondly, AdBlock Plus will allow you to block certain sites or scripts from loading that you specify. This again saves valuable resources and sometimes is necessary since iMacros still appears a bit buggy when trying to figure out whether a page is done loading or not.</p>
<p><strong>3) Disable loading images automatically</strong>. 99% of the time there is no point to loading images either unless your system is some sort of image scraper. Although iMacros has an image removal function (&#8216;FILTER TYPE=IMAGES STATUS=(ON|OFF)&#8217;) I prefer disabling images via Firefox instead. I highly recommend disabling images in Firefox by going to Tools/Options clicking the &#8216;Content&#8217; tab and removing the checkmark on &#8216;Load images automatically&#8217;. If you have images that might be an exception, say a captcha image, you can simply click the &#8216;Exceptions&#8217; button and add the url of the exception. I&#8217;ve also included an iMacro in the package above that will allow you to disable and re-enable images in Firefox.</p>
<p><strong>4) Make every browser session you start a private browsing session.</strong> You can do this by going to: Tools/Options/Privacy in Firefox and then choose in the drop down &#8220;Firefox will never remember history&#8221;. The reasoning for this is that I&#8217;ve found the iMacros &#8220;CLEAR&#8221; command is unreliable.</p>
<p><strong>The scripts/PHP code I&#8217;ve written:</strong></p>
<p><strong><a href="http://dl.getdropbox.com/u/2474298/proxy.iim">iMacros Firefox Proxy  Setting Script</a> </strong>(taken from: http://thepemberton.com/posts/archives/23 and modified a little bit)</p>
<p>To use it, simply replace {{IP}} and {{PORT}} with the IP and port of your proxy.</p>
<p><strong><a href="http://dl.getdropbox.com/u/2474298/abp.iim">iMacros AdBlock Plus enable/disable script</a></strong></p>
<p>To use it, simply install ABP and then modify {{status}} to &#8216;true&#8217; or &#8216;false&#8217; to enable or disable it.</p>
<p><strong><a href="http://dl.getdropbox.com/u/2474298/images.iim">iMacros Firefox images enable/disable script</a></strong></p>
<p>To use it simply replace {{images}} to 1 or 2 to enable or disable images in Firefox.</p>
<p><strong><a href="http://dl.getdropbox.com/u/2474298/iimfx.class.php">iimfx.class.php </a></strong></p>
<p>This file allows you to run iMacros from PHP with ease providing your running the iimRunner.exe. I haven&#8217;t documented it very well, but if you take a look through it you should be able to easily figure it out. Any updates, changes you see fit, please let me know, I&#8217;d love to improve on it. You&#8217;ll also need the 3 previous scripts above to use it appropriately as it&#8217;s customized for my setup.</p>
<p>The code of iimfx.class.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> imacros <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$proxyip</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$proxyport</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$silent</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$noexit</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;--------------------------------------<span style="color: #000099; font-weight: bold;">\n</span>New imacros session started!<span style="color: #000099; font-weight: bold;">\n</span>Using Proxy: <span style="color: #006699; font-weight: bold;">$proxyip</span>:<span style="color: #006699; font-weight: bold;">$proxyport</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">proxyip</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$proxyip</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">proxyport</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$proxyport</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">proxyip</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;NO PROXY!!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">noexit</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$noexit</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fso</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> COM <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Scripting.FileSystemObject'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fso</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iim</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> COM <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;imacros&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$toexec</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;-runner -fx -fxProfile default&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$silent</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$toexec</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; -silent&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$noexit</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$toexec</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; -noexit&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$toexec</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iim</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iimInit</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$toexec</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #990000;">empty</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">proxyip</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$dvars</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'IP'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">proxyip</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$dvars</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'port'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">proxyport</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">play</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dvars</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'proxy'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> __destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">noexit</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iim</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iimExit</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> play<span style="color: #009900;">&#40;</span><span style="color: #000088;">$immvars</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$macro</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;--------------------------------------------------------<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$immvars</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$immvars</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Setting Value <span style="color: #006699; font-weight: bold;">$key</span> =&gt; <span style="color: #006699; font-weight: bold;">$value</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iim</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iimSet</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;-var_&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Playing Macro <span style="color: #006699; font-weight: bold;">$macro</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$s</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iim</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iimPlay</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$macro</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$s</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Macro successfully played!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;--------MACRO ERROR!-------------------<span style="color: #000099; font-weight: bold;">\n</span> ERROR: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLastError</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$s</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// This function retrieves extracts in your iMacros script if you have any. </span>
	<span style="color: #000000; font-weight: bold;">function</span> getLastExtract<span style="color: #009900;">&#40;</span><span style="color: #000088;">$num</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iim</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iimGetLastExtract</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$num</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Returns the last error :)</span>
	<span style="color: #000000; font-weight: bold;">function</span> getLastError<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iim</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">iimGetLastError</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Enables/disables images</span>
	<span style="color: #000000; font-weight: bold;">function</span> setImages<span style="color: #009900;">&#40;</span><span style="color: #000088;">$images</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// 1 = on 2 = off</span>
&nbsp;
		<span style="color: #000088;">$dvars</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'images'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$images</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">play</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dvars</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'images'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Enables or disables adblockplus</span>
	<span style="color: #000000; font-weight: bold;">function</span> enableABP<span style="color: #009900;">&#40;</span><span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$dvars</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'status'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$status</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">play</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dvars</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'abp.iim'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=218</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Scraping Forms with DOM and PHP for Posting with CURL</title>
		<link>http://www.exosus.com/?p=164</link>
		<comments>http://www.exosus.com/?p=164#comments</comments>
		<pubDate>Wed, 02 Sep 2009 02:13:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[My Terrible Coding]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=164</guid>
		<description><![CDATA[I posted in the past about scraping forms for use when you need to make a post using CURL along with a little bit of code. I&#8217;ve recently moved on to using DOM and this little function I wrote below. I finally got fed up with sites adding new hidden fields and having to write [...]]]></description>
			<content:encoded><![CDATA[<p>I posted in the past about scraping forms for use when you need to make a post using CURL along with a little bit of code. I&#8217;ve recently moved on to using DOM and this little function I wrote below. I finally got fed up with sites adding new hidden fields and having to write preg_matches for unique variables that a lot of sites are stuffing into their forms these days to prevent spammers and/or track sessions. </p>
<p>If you don&#8217;t have the plugin already in you need the php-xml plugin. Depending on your setup &#8216;yum install php-xml&#8217; should do the trick.</p>
<p>$html is the html code of the site you&#8217;d get using file_get_contents, CURL or whatever.</p>
<p>$form_number is the number of the form you want &#8211; 1. It&#8217;s usually ok just to leave this at 0 but sometimes sites have more than 1 form on the page so you have to specify. </p>
<p>The postData array is returned and ready for posting in CURL, all you need to do is find the few fields you actually need to specify and update those fields within the postData array. It&#8217;s usually as easy as $postData['email'] = myemail@emailme.com;</p>
<p><strong>Updated Sept. 1st, 2009. </strong>This is my inputs.php. Some input fields I&#8217;ve found had some unique text names to make posting data more annoying. To quickly build around this I built a few functions to pull those as well by providing known parameters such as the inputs width, textsize, etc. It&#8217;s similar to what iMacros does.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> getInputs<span style="color: #009900;">&#40;</span><span style="color: #000088;">$html</span><span style="color: #339933;">,</span> <span style="color: #000088;">$form_number</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #339933;">@</span><span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadHTML</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$html</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//@ is there cuz this will throw up a bunch of errors if the html code isn't perfect</span>
&nbsp;
&nbsp;
	<span style="color: #000088;">$forms</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;form&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$forms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$form_number</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Gets input areas and also checks to make sure the form exists</span>
&nbsp;
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$inputs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;input&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Form does not exist! Line: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">__LINE__</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$inputs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$input</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$attval</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #990000;">empty</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attval</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$postData</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$attval</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'value'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Gets textareas</span>
&nbsp;
&nbsp;
	<span style="color: #000088;">$inputs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;textarea&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$inputs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$input</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$attval</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #990000;">empty</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attval</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$postData</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$attval</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Gets buttons</span>
&nbsp;
&nbsp;
	<span style="color: #000088;">$inputs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;button&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$inputs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$input</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$attval</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'value'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #990000;">empty</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attval</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$postData</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$attval</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'value'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Gets selects</span>
&nbsp;
&nbsp;
	<span style="color: #000088;">$inputs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;select&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$inputs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$input</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$attval</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> <span style="color: #990000;">empty</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attval</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$postData</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$attval</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$postData</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> getForms<span style="color: #009900;">&#40;</span><span style="color: #000088;">$html</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #339933;">@</span><span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadHTML</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$html</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$xpath</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMXPath <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dom</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$forms</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">evaluate</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;/html/body//form&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$returnform</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$forms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">length</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$forms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$returnform</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'action'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$returnform</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Finds unique variables by finding other variables within the form</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> findUniqueInput<span style="color: #009900;">&#40;</span><span style="color: #000088;">$html</span><span style="color: #339933;">,</span> <span style="color: #000088;">$variables</span><span style="color: #339933;">,</span> <span style="color: #000088;">$form_number</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #339933;">@</span><span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadHTML</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$html</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//@ is there cuz this will throw up a bunch of errors if the html code isn't perfect</span>
&nbsp;
&nbsp;
	<span style="color: #000088;">$forms</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;form&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$forms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$form_number</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Gets input areas and also checks to make sure the form exists</span>
&nbsp;
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$inputs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;input&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Form does not exist! Line: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">__LINE__</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$keys</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_keys</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$variables</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$inputs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$input</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$good</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$keys</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$keys</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$variables</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$keys</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$good</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$good</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'name'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Found Input!&quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> findUniqueTextArea<span style="color: #009900;">&#40;</span><span style="color: #000088;">$html</span><span style="color: #339933;">,</span> <span style="color: #000088;">$variables</span><span style="color: #339933;">,</span> <span style="color: #000088;">$form_number</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #339933;">@</span><span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadHTML</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$html</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//@ is there cuz this will throw up a bunch of errors if the html code isn't perfect</span>
&nbsp;
&nbsp;
	<span style="color: #000088;">$forms</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;form&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$forms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$form_number</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Gets input areas and also checks to make sure the form exists</span>
&nbsp;
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$inputs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;textarea&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Form does not exist! Line: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #009900; font-weight: bold;">__LINE__</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$keys</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_keys</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$variables</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$inputs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$input</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$good</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$keys</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$keys</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$variables</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$keys</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$good</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$good</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'name'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Found TextArea!&quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>Example getting a unique input name.<br />
</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000088;">$variables</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;maxlength&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'10'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;size&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'10'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;tabindex&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'1'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// the other variables of the text input that you want to retrieve</span>
	<span style="color: #000088;">$uniqueName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">findUniqueInput</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$variables</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>function getInputs example</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFile</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.wordpress.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// integrates with my curl class (you can replace this with file_get or something similar depending on what you use.)</span>
                <span style="color: #000088;">$postData</span> <span style="color: #339933;">=</span> getInputs <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$text</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// gets the inputs from the html returned</span>
		<span style="color: #000088;">$postData</span> <span style="color: #009900;">&#91;</span>login<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$login</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// sets the unique variables needed for the post</span>
		<span style="color: #000088;">$postData</span> <span style="color: #009900;">&#91;</span>password<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$password</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">curl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFile</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.wordpress.com&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$postData</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// posts our data to wordpress, p.s. this is just an example and won't actually work with wordpress.</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=164</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Handling Redirects with PHP/CURL</title>
		<link>http://www.exosus.com/?p=181</link>
		<comments>http://www.exosus.com/?p=181#comments</comments>
		<pubDate>Mon, 29 Jun 2009 10:59:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[My Terrible Coding]]></category>
		<category><![CDATA[Nifty Little Tricks]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=181</guid>
		<description><![CDATA[Ever wanted to see all the different redirect urls a particular link redirects through with PHP/CURL? Now you can with this nifty little piece of code (the only thing I haven&#8217;t written yet is a way to handle redirects that don&#8217;t contain the hostname). Anyway, with that said, check this out: 1 2 3 4 [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to see all the different redirect urls a particular link redirects through with PHP/CURL? Now you can with this nifty little piece of code (the only thing I haven&#8217;t written yet is a way to handle redirects that don&#8217;t contain the hostname). Anyway, with that said, check this out:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.somesiteyouknowuseslocationredirect.com&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$curl_info</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_getinfo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$redirect_count</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$curl_info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'redirect_count'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$header_size</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$curl_info</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'header_size'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$header</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$header_size</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$redirecturls</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$redirect_count</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/location:(.*?)<span style="color: #000099; font-weight: bold;">\n</span>/is&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$header</span><span style="color: #339933;">,</span> <span style="color: #000088;">$locations</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$locations</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$location</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$redirecturls</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$location</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=181</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why marketing works</title>
		<link>http://www.exosus.com/?p=176</link>
		<comments>http://www.exosus.com/?p=176#comments</comments>
		<pubDate>Thu, 18 Jun 2009 18:46:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Random Rants]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=176</guid>
		<description><![CDATA[This was a conversation about a sketchy ad I put together with a hot chick on it. (11:41:16 AM) Brett: yowzas (11:41:19 AM) Brett: i&#8217;d hit it (11:41:50 AM) Me: would u click it (11:42:05 AM) Brett: well i&#8217;m not a retard, so no (11:42:15 AM) Brett: but luckily movies like dance flick and scary [...]]]></description>
			<content:encoded><![CDATA[<p>This was a conversation about a sketchy ad I put together with a hot chick on it.</p>
<p><span style="font-weight: normal;"><span style="font-size: x-small;"><span style="color: #cc0000;">(11:41:16 AM) </span></span></span><span style="font-weight: bold; color: #cc0000;"><span style="font-size: small;">Brett: </span></span><span style="font-size: small;">yowzas</span><br />
<span style="font-weight: normal;"><span style="font-size: x-small;"><span style="color: #cc0000;">(11:41:19 AM) </span></span></span><span style="font-weight: bold; color: #cc0000;"><span style="font-size: small;">Brett: </span></span><span style="font-size: small;">i&#8217;d hit it</span><br />
<span style="font-weight: normal;"><span style="color: #204a87;"><span style="font-size: x-small;">(11:41:50 AM) </span></span></span><span style="font-weight: bold; color: #204a87;"><span style="font-size: small;">Me: </span></span><span style="font-size: small;">would u click it</span><br />
<span style="font-weight: normal;"><span style="font-size: x-small;"><span style="color: #cc0000;">(11:42:05 AM) </span></span></span><span style="font-weight: bold; color: #cc0000;"><span style="font-size: small;">Brett: </span></span><span style="font-size: small;">well i&#8217;m not a retard, so no</span><br />
<span style="font-weight: normal;"><span style="font-size: x-small;"><span style="color: #cc0000;">(11:42:15 AM) </span></span></span><span style="font-weight: bold; color: #cc0000;"><span style="font-size: small;">Brett: </span></span><span style="font-size: small;">but luckily movies like dance flick and scary movie make it to #1 box office</span></p>
<p><span style="font-size: small;">I think that was pretty well said.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=176</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some of my friends think I&#8217;m stupid</title>
		<link>http://www.exosus.com/?p=157</link>
		<comments>http://www.exosus.com/?p=157#comments</comments>
		<pubDate>Mon, 09 Feb 2009 23:12:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Random Rants]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=157</guid>
		<description><![CDATA[I&#8217;m gunna go cry now. Thx. Seriously though, I normally don&#8217;t like posting content that is completely useless on my blog but I laughed pretty hard when I saw this for an IQ offer.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m gunna go cry now. Thx. Seriously though, I normally don&#8217;t like posting content that is completely useless on my blog but I laughed pretty hard when I saw this for an IQ offer.</p>
<p><img class="alignnone size-full wp-image-158" title="lol" src="http://www.exosus.com/wp-content/uploads/2009/02/lol.gif" alt="lol" width="354" height="202" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=157</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A lot of Gmail email addresses, yet only 1 Gmail account.</title>
		<link>http://www.exosus.com/?p=153</link>
		<comments>http://www.exosus.com/?p=153#comments</comments>
		<pubDate>Thu, 05 Feb 2009 22:55:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Nifty Little Tricks]]></category>

		<guid isPermaLink="false">http://www.exosus.com/?p=153</guid>
		<description><![CDATA[ Basically Gmail strips all .&#8217;s out of an email address when it receives the email. So you can essentially make 100s of different email addresses out of only 1 gmail address by simply taking your current email and adding .&#8217;s to it. For example: exosusrocks@gmail.com and making it e.xosusrocks@gmail.com, e.x.osusrocks@gmail.com, so on and so forth will [...]]]></description>
			<content:encoded><![CDATA[<p> Basically Gmail strips all .&#8217;s out of an email address when it receives the email. So you can essentially make 100s of different email addresses out of only 1 gmail address by simply taking your current email and adding .&#8217;s to it. For example: exosusrocks@gmail.com and making it e.xosusrocks@gmail.com, e.x.osusrocks@gmail.com, so on and so forth will all still go to exosusrocks@gmail.com.  It comes in handy when say you want to create a new user on a forum but don&#8217;t want to have to create a new email address.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exosus.com/?feed=rss2&amp;p=153</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
