WordPress Google Reader Widget

Number 3 in Widget-A-Day is a Google Reader widget.

This widget will display your latest shared stories. You can change the amount of stories to display and how to display them.

UPDATE- 1.1, 1.2

Download googlereader.zip

Default display:
googreader1cropped.png

Admin panel:
googreader2cropped.png

Download googlereader.zip

SVN Checkout
svn co http://svn.wp-plugins.org/google-reader-widget/trunk

Requirements

Installation

  1. Download googlereader.zip
  2. Extract and upload googlereader.php to the plugins/ directory
  3. Enable Google Reader in the Plugin admin panel
  4. In widget admin panel, place Google Reader in the sidebar, and edit it to enter your user id

Features

  • Displays your latest shared items from Google Reader
  • Completely customizable display
  • Caching for large traffic sites


User ID

In order to get your shares, you need to know your user id according to Google Reader. This can be found by going to the ‘Shared Items’ link, and copying the 20 digit number at the end of your shared items link.

So something like:
http://www.google.com/reader/shared/02774557510273097991
Where 02774557510273097991 would be my user id.

Formatting

There are 3 parts needed to format the output.

The first part, called items start in the admin panel, is the first part of the widget after the title. For the default formatting, this is just <ul>.

The second part, called items end, is the ending of the widget. By default, this is:
</ul>
<a href="%googlereader%" style="float:right;">Shared Items</a>

The third part is what is called for each item. By default, this is:
<li style="list-style-type: none;"><a href="%link%">%title%</a></li>

The premise of calling each value is this:

  1. start
  2. item
  3. item
  4. item
  5. end

The formatting for items is:

  • %link% - Link to the item
  • %title% - Title of the item
  • %site% - The title of the site the item is from
  • %sitelink% - The link to the site the item is from
  • %number% - The number of the current item
  • %comment% - The comment (note) made when sharing an item

The formatting for start and end is:

  • %googlereader% - Link to your Google Reader shared page
  • %count% - Number of items shown
  • Download googlereader.zip (googlereader.tar.gz)

    New Version

    I’ve made a new version based on suggestions form the comments. This one will allow you to link to just the originating site. This adds two new variables the style can use.

    • %site% - The title of the site the item is from
    • %sitelink% - The link to the site the item is from

    This has been merged with the current version.

WordPress Last.fm Widget Widget

Number 2 in Widget-A-Day is a widget for the last.fm widgets.

It can show the chart of your recent tracks, top tracks, and top artists (weekly tracks and artists don’t work currently since the value varies throughout). You can also choose between red, blue, black, and green.

Download lastfm.zip (lastfm.tar.gz)

Here is the default view:
lastfm1cropped.png

Here is the admin panel:
lastfm2cropped.png

Requirements

Installation

  1. Download lastfm.zip (gz)
  2. Extract and upload lastfm.php to the plugins/ directory
  3. Enable Last.fm Widget - New Style in the Plugin admin panel
  4. In widget admin panel, place Last.fm in the sidebar, and edit it to enter your username

Download lastfm.zip (lastfm.tar.gz)

Compete WordPress Widget

Compete released it’s API today, so I decided to make a widget for WordPress using it.

Download compete.zip

SVN Checkout
svn co http://svn.wp-plugins.org/compete-widget/trunk

This adds a link, your current rank, the amount of visitors, and your rank image to the sidebar.

By default, it looks like:
wpcompetecropped1.png

In the widget admin panel, you can completely edit the title, your api key, your host (by default, it’s the current host), the amount of time before the cache expires, and the ability to completely edit the display (see below)

wpcompetewidcropped1.png

Requirements

Installation

  1. Download compete.zip
  2. Extract and upload compete.php to the plugins/ directory
  3. Enable Compete Rankings in the Plugin admin panel
  4. In widget admin panel, place Compete in the sidebar, and edit it to enter your API Key

Features

  • Displays data about your site or any site you choose
  • Edit nearly all aspects of it via widget admin
  • Caching for large traffic sites

Editting display

You can edit ‘Widget Formatting’ to change how the info is displayed. To access the variables, use this formatting:

  • %rank% - Rank of the site
  • %icon% - The icon relating to your traffic rank (large or small depending on options)
  • %count% - People count
  • %host% - Hostname used in lookup
  • %link% - Link to the compete page for the host
  • %compete% - The compete link - Compete.com

The default formatting is:

<span style="float:right;"><img src="%icon%" alt="%rank%" /></span>
<a href="%link%">%host%</a><br />

Ranking: %rank%<br />
People: %count%<br />
%compete%

Download compete.zip

New Paintball Classifieds Site

I just finished making a new paintball classified site that takes feeds from various paintball sites across the web, and brings them into one easy to use place.

Paintball Classifieds - Find Paintball Gear to Buy, Sell, or Trade

Here’s how the front end works:

First, you go to the site, and are presented with the 20 latest posts from around the web.

You can then choose to only browse a certain category

You can then view the contents of the post on the current site.

If you are interested in the item, you can then view the original post on the original site, and contact the seller.

You can also search all the posts from the site. This just uses LIKE. I was going to use FULLTEXT, but for compatibility and size reasons, decided against it.

On the back end, you set up a cron job to run a certain php file every 15 minutes (this can be less or more depending on your taste). It then runs through the feed table find ones that need to be updated (this is based on an update frequency value you set for each feed).

It then requests that feed and inserts the items into the rss items table. The link is a UNIQUE key, meaning it won’t insert duplicate items.

After inserting the items, it updates the last update time for that feed, and waits for the next time. Some feeds are updated every hour, while others are updated every 6 hours depending on the feed site’s traffic.

Features:

  • Fully automated - Add a cron job, and it’s off to the races
  • Monetized via ads or eBay affiliation
  • Pretty URLs

Requirements:

  • PHP 4/5
  • MySQL Database
  • mod_rewrite (or lighttpd)

Note: First plan was to sell this, but I’m just going to open source it.

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 server.py.

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

Download:

Download as tar.gz
Download as ZIP

Screenshots:

Auto Scrolling Apache Log Script

Here is a python script that will print new requests to your server. I’m sure there are a lot of these, but I couldn’t find any when I searched.

Anyway, set logloc to the location of your log file, and if you want it to update more quickly or slower, change updatefrq to the amount of seconds you want it to update.

It currently won’t display the very last line.

logfilepyss.png

Here it is:

#! /usr/bin/env python
 
logloc = "/var/log/apache2/access.log" # Location of log file. Can be relative
updatefrq = 60   # num of seconds between updating. Just sleep(updatefrq)
 
 
from time import sleep
 
while 1:
	try:
		pointer = open("pointer.txt",'r').read()
	except:
		pointer = 0
		open("pointer.txt","w").write(pointer)
	file = open(logloc,'r')
	file.seek(int(pointer))
	line = file.readline().replace("\n","")
	while line != "":
		print line
		line = file.readline().replace("\n","")
	open("pointer.txt","w").write("%d" % (file.tell(),))
	file.close()
 
	sleep(updatefrq)

Or download as a .txt file

Simple Weather

weather.com 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 weather.com 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 “weather.com” 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.

Source.zip

Update 04/19:

I’ve added support for permalinks, like http://xrho.com/weather/77450 from a suggestion on this TechCrunch article about SimpleWeather, which I can’t believe they actually mentioned.

XLMPP

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.

Usage:
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.

Issues:
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:
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.

Game Site Script v0.1

Finished it up enough to constitute a version 0.1 release. Didn’t find any big bugs. The admin panel is a little ‘meh’, but it works. Decided to try Trac this time around. Hopefully it will be easier on me than what I’ve done in the past.

Download Game Site Script

Also, I’ve made a game pack for it:
Gamepack1

Flash Game Site

I finished, for the most part, my flash game site script that I mentioned earlier. It took longer than I really expected it to. Ran into some really stupid snags with inconsistencies in PHP, namely order of variables and underscores in their functions. Anyways, have most of the site done with only maybe a couple of small changes. Still have more to do with the admin panel.

Right now it almost a turn key site. You input a few variables, like name, AdSense pub_id, etc., and you have a game site, minus the games, which aren’t that fun to upload. Right now, it can take the info from some v3arcade game scripts and automatically input all the right info.

I’m not sure if I’m going to release it for free or charge like $5 or $10 for it. The amount of people that would get it either way would be low, so I don’t know. It’s just the fact that it’s set up for you to make money with minimal set up is the reason for it to maybe not be free.

Anyways, check out Free Fun Flash Games for a look at the script in action.

Close
E-mail It