Fun with Digg’s API

Digg’s api was released about a week ago a while ago, and since that time, various flash projects have surfaced, probably due to that pesky contest. But I don’t have any flash experience, so PHP, here we come.

We’re going to make various tag clouds, a Reddit clone, Reddit/Better RSS feed, and a live diggs app.

Update – 05/09/07 – 3 PM – Stupid host seems to be having database issues. Great. I wish I could afford a dedicated, or I guess VPS, so I don’t have to put with this crap.

Update – 05/09/07 – 6 PM – It seems that it was a combination of their db sucking and the fact they got rid of some essential pear packages. WTF?

Update – 05/12/07 – 11 AM – Yup. They cut off my MySQL abilities. I can’t connect to any of my databases on This site is fine however. I guess inserting 100+ entries a minute might have annoyed them?

Update – 05/17/07 – 7 PM – The MySQL abilities are still cut off. Fucking netfirms. Also, it seems in one of my updates, it cut off the bottom, which also happened to include the download links. You can download a ZIP or Gzip of the files. Since I’m having problems with that, feel free to download them and run them on your own site. Let me know if you do so I can add the link.

Demos of most of the scripts are available here, and more specifically:

Due to the length of this post, I’m splitting it. I hate making people click through, but it’s long enough to constitute it.
Continue reading “Fun with Digg’s API”

Paintball RSS Feeds

If you didn’t know, I loves me Google Reader. It’s just so badass, but many paintball sites don’t have RSS feeds, or they’re hidden away. Most are stuck in the old, you have to go to the site site to get content phase. But, I’ve compiled a list of paintball releated RSS feeds, which some had to be made using

Or here they are:

Paintball Headlines – New Paintball Blog. Disclaimer: This is my site


You can have feeds for certain categories by adding feed to the end, like In The Media,

PbNation – Yes, I do hate the some of the people running the site, but they do have a user base.

News –
Tournaments (smaller ones) –,345,284,390,185,379,446,266,222,232,445,250,67,381,444,442,400,281,364,65
Tournaments (PSP, NPPL, Millenium) –,64,317 – NEWS Junkie and news forum. Not really sure what the differences are, but they usually have different content. Pretty good feed.
News –
News –

PbReview – Meh
News –

68 Caliber Has Been Removed. See this post. – Removed. Changed site design. – These are hidden away somewhere, but google found them
Headlines –
PRWire –

PSP – Tournament news. Feed 43
News –

ESPN – Any mentioning of paintball on the ESPN site
News –

Google BlogSearch – This is the feed for the search ‘paintball’. Not too bad of a source
News –

Technorati – The feed for the tag search of ‘paintball’. Mostly useless.
News –

PBHeadlines – Not to be confused with Paintball Headlines. Removed for being utter crap.

PbBucket – Removed since site has completely changed.

Paintball Journal – No longer updated. – Removed due to being a douchebag.

PaintballTimes – Kinda screwed up feed, and rarely updated?
News – – This indexes various B/S/T feeds and mashes them together. Full content. Disclaimer: This is my site.
B/S/T –

If you have anymore, let me know so I can add it. I’ll update this post as I find more feeds.

Last updated – Jun 17, 2007, Jul 11, 2007

Windows sucks at DNS caching

Here is the graph of my DNS queries in the past month via opendns


Notice how the left is about 10 times taller than the right. What changed? Switching over to Linux, and that’s it. I’m still doing basically the same thing as before. You can see that from the graph of unique domains.


Now, it does show it as less, but nowhere near the drop off as shown in the previous graph. Which leads me to believe that either I had some program that was doing crap it shouldn’t have been, or Linux is just better at caching DNS info.

If you’re wondering, the complete drop off is where I switched over to linux. It took me a while to get around setting up opendns.

Amarok Jukebox

I’ve coded a jukebox script for amarok. It consists of a python HTTP server and an amarok control script. Unlike this one, it is not a script to add to amarok. It’s completely separate. It’s also only 3 python files. Also, AJAX! 🙂

What it does:
You visit the url, where you can then control the player, or search for songs, albums, or artists. After searching, you can then add songs to the current playlist. This can be accessed via any browser in the lan, or, if you’re ports are forwarded correctly, the internet.

Using it:
You start it by running python

You use it by going to http://localhost:7000/.


Download as tar.gz
Download as ZIP


Simple Weather logo There’s a site called SimpleWeather. It prides itself on being simple. Enter a zip code, and you get the weather. Go there again, and it will automatically show you the current weather for your location. It’s so awesome that it can remember your location.

But being too simple has it’s drawbacks, such as being able to be ripped off very quickly and easily, such as in 1 hour.

WeatherSimple 😉

It took me just about an hour to make that in 120 lines of PHP (plus about 35 lines of javascript and 20 of CSS), and I have a site that does everything this SimpleWeather does, and a little more.

Such as not being limited to a zip code, you can enter “Houston”, and be given the option of choosing the exact location. It also does the requests in AJAX, though not very well.

It doesn’t look as pretty, but probably another hour in Photoshop and messing with the CSS, it could be there. Nor does it have a nice domain name associated with it, because I have no plan on launching it as some site.

It also fixes the problem with not showing the High after 3 PM, by a incredibly simple fix, just show the next day’s.

Really, what makes it so easy, is that basically supplies everything you need. It even gives you images and tells you which image to use. Now, it does give you some pretty annoying restrictions, like your logo can overpower the Weather Channel logo, you can’t fuck with their logo, such as the ‘W’ in “Weather” is 1/2 of the space of the word “” from the sides, and a whole set of caching requirements.

Note: I didn’t really follow any of them. I did give attribution though.

Anyways, here’s the source. You need the class SimpleXML, which is the reason it’s hosted on xrho instead of this site, since PHP 5 is required.

Update 04/19:

I’ve added support for permalinks, like from a suggestion on this TechCrunch article about SimpleWeather, which I can’t believe they actually mentioned.

Access MySQL Command Line in XAMPP

Or XLMPP for that matter 😉

There are two ways to do it. Both are basically the same, but one just makes it a lot easier. We’ll go over the harder one first.

First Method:

Start the command prompt, and cd to the xampp directory. It’ll usually be something like:
cd ../../Program Files/xampp
if you used the installer and default install location.

Once in there, cd to the mysql bin directory.
cd mysql/bin

Now, run the command:
mysql.exe --user=root --password=
And the MySQL command line will start. If you’ve changed the username or password of the MySQL user, you need to change the –user= and –password= accordingly.

Second method:

Basically the same way as before, but we’ll create a batch file to make it easier.

First, create a file called mysql_command.bat in the XAMPP directory.

Edit this file with Notepad or any text editor, and paste in this:

@echo off

echo Starting MySQL command line...

mysql\bin\mysql.exe --user=root --password= 


Save it, and change the –user= and –password= if you’ve changed the user or password.

Now, run mysql_command.bat and a command prompt will show up with the MySQL command line running.

It’s as easy as that.


XLMPP is XAMPP, but instead of Apache, it uses lighttpd.

This is from version 1.6.0a of XAMPP and lighttpd is 1.4.13 from here.

This is a very primitive release. There are of course problems with it. If you find something not listed or have a fix for it, please let me know.

1. Run setup-xampp.bat to update configuration.
2. Run lighttpd_start.bat to start lighttpd.
3. Use the .bat files to start or stop the other components.

1. The xampp-start.exe, xampp-stop.exe, xampp-control.exe either don’t work, or don’t work well. If someone wants to fix these, please do so.
2. Perl, I didn’t test, but should work.
3. XAMPP is still shown everywhere instead of XLMPP. Meh.
4. No installer
5. Only for Windows
6. Doesn’t work on Vista, or shouldn’t, since lighttpd doesn’t.
7. Setup changes lighttpd.conf even if you don’t select ‘Refresh XAMPP’.

Changes between XAMPP and XLMPP:
1. lighttpd directory added.
2. lighttpd_start.bat and lighttpd_stop.bat created
3. apache_start.bat and apache_stop.bat edited to start lighty instead
4. install.php edited to edit lighttpd.conf. (lines 57-68)
5. apache directory deleted.

Download XLMPP in ZIP archive (75.6 MB) This was removed for being outdated.
MD5: 362ff2b7366d3457061d3e7d8f2098a2

Download lighttpd + XAMPP->XLMPP files (3.68 MB)
MD5: 382d8ff96c83294dd40879dbcc506663
You need some version of XAMPP. Extract this archive into that folder, overwriting existing files. Run setup_xampp.bat. Start lighttpd by running lighttpd_start.bat. (Note: This lighttpd is probably outdated now)

(XAMPP + lighttpd) -> XLMPP files (10.2 KB)
MD5: 2e39627fe17c612f5880f7b93971e4ce
You need a version of XAMPP and lighttpd. Copy the lighttpd directory into the XAMPP directory. Extract this archive to the XAMPP directory, overwriting existing files. Run setup_xampp.bat. Start lighttpd by running lighttpd_start.bat. This includes the new batch files, new install file, and a new lighttpd.conf.

BB Code Parser

I’ve been looking for a good BBCode parser, and never really found any good ones that were small, easy to deploy, and worked properly. They were either really large, required the whole class deal, or just didn’t work right. All the str_replace method ones don’t account for non closed tags, so an open [b] will amke the rest of the page bold. Some of the preg_replace method ones used something like [b](.*)[/b], which something like
[b]bold[/b] not bold [b]bold again[/b]
will evaluate to
bold[/b] not bold [b]bold again
Other parsers used (.+?) which will work for multiple tags, but not nested tags, like
[b]bold[b]still bold[/b][/b]
would evaluate to
This is fixed by adding a while loop checking preg_match of the regex.

Anyways, I broke down and wrote my own. It correctly parses everything I’ve thrown at it without any vulnerabilities, like javascript: uris, that other parsers had problems with.

Demo of BB Code Parser

Download as single txt file
Download in ZIP format


BB Code Parser – Parses BB Code correctly without using classes.

Maple Command Generator – Will create commands to use with Maple. Can create commands for most things done in Calculus I, II, and III.

Game Script – This is an adsense ready script for a flash game site. Demo is here.

Custom Style Generator – This would create a custom style using Greasemonkey for PbNation, but since they sent me a copyright infringement notice, I took it down. You can download the source and still be able to create the styles. You need PHP, and MySQL if you want to use the Showcase feature.

Wget 2 – Basically an alternative to wget that downloads the files in parts. It’s not fast, but uses a small file cache which allows you to use it on hosts that might only allow like 8 MB of cache. Written in python. There are still a couple of problems with the new version that uses XML files to denote the parts that are delaying it’s release.

Simple Remote Client – A simple client that tells you your uptime, processes, netstat, screenshot, and allows you to execute commands on a host computer through a web interface. The web interface uses PHP and files, and the client is done in python. Demo. Note: I haven’t used this in a while, I just use Logmein now.

Sites – Owners Group for Diablo Paintball Guns. Needs to have the code revamped. – Mainly bought to prevent one company from snatching it up. Just random cat pics now (or see all the kitties!). Available for non-profit use. – Site written for my uncle’s company. One of the first websites I made. – Paintball News site. Never really got off the ground. Based on Pligg. – Mainly used for file storage and PHP 5 testing. – Flash game site. Custom script I created. Available on the scripts page – Site for MySpace codes, images, and other things. Based on some script someone gave me. It seemed kinda cool.

Social Networking: