Craigslist is an interesting marketplace and is a bit behind the times technology wise.  Many people enjoy the simple interface and easy to understand style, however if you try to use craigslist for more than your local area you might encounter a huge time expense.  Craigslist helper which is on google search has a nice little feature to help you search multiple places at once.

I decided it couldn’t be all that hard to do this especially considering craiglist’s incredible rss search ability.  So with the download of magpierss to do the rss parsing it was really just a matter of bring it together.

With out further ado, craigslist job query

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require_once('rss_fetch.inc'); //magierss
 
	$subdomains = array('atlanta','austin','boston','chicago','dallas'
,'denver','houston','lasvegas','losangeles','miami','minneapolis',
'newyork','philadelphia','phoenix','portland','raliegh','sacramento',
'sandiego','seattle','sfbay','washingtondc');
	$query = 'fudge'; // your query here
 
	foreach($subdomains as $skey=>$subdomain){
		$url="http://$subdomain.craigslist.org/search/jjj?query=$query&format=rss";
		$rss = fetch_rss( $url );
 
		echo "<h2>$subdomain : " . $rss->channel['title'] . "</h2>";
		echo "<ul>";
		foreach ($rss->items as $item) {
			$href = $item['link'];
			$title = $item['title'];
			$desc =  $item['description'];
			echo "<li><a href=$href>$title</a><p>$desc</p></li>";
		}
		echo "</ul>";
	}
?>

We shall neither fail nor falter; we shall not weaken or tire…give us the tools and we will finish the job.
Winston Churchhill

craigslist+job+query+search+php+script addthis
Our Sponsors

Hello Readers,

If you read the past series on Hangman you will pleased to know I’m releasing a version of the code that includes a word list that is based off of GRE/SAT vocabulary list. It also implements AJAX to allow for real-time drawing of PNGs with GD.

This is really a easy to install and use program. Just drag and drop

Download Now

Hangman+AJAX+written+in+PHP+download+available addthis

Football has always been an American pastime and also a programming one as well. Ever year EA Games as well as many others are busy building the next years hottest simulator for our entertainment sports.

When I played pro football, I never set out to hurt anyone deliberately - unless it was, you know, important, like a league game or something.
-Dick Butkus

Today I’m going to teach you how to build something similar to NES Tecmo Super Bowl, without the play sequence. The play sequence is too fast to simulate on web and will be left as an exercise with flash or a related software.

The steps I’ve chosen to do to accomplish this are as follows
Determine a basic win/loss formula for play selection
Develop In Depth Data for more realistic feel
Bring it all together

So for the first step it’s quite easy. I want to think of something that after the play is chosen in football, how to determine the outcome. A simple formula might involve the following variables

Offensive play choice
Defensive play choice
Offensive team power
Defensive team power
Random Variation

Based around these simple variables I should be able to determine what is the outcome of a given play. Here is an example in php

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
 
$off_play_choice = $_GET['oselect'];
$def_play_choice = $_GET['oselect_def'];
 
$off_power = determine_off_strength(); // a summation of individual's strength
$def_power = determine_def_strength();
 
if($playtype = 'run'){
$min_yards_run = .3;
$max_yards_run = 3.6;
$avg_run = 2;
 
$minstd = calc_std($min_yards_run,$max_yards_run,$avg_run);
$maxstd =  calc_std($min_yards_run,$max_yards_run,$avg_run);
}else{
$min_yards_pass = .3;
$max_yards_pass = 3.6;
$avg_pass = 2;
 
$minstd = calc_std($min_yards_run,$max_yards_run,$avg_run);
$maxstd =  calc_std($min_yards_run,$max_yards_run,$avg_run);
}
 
// this forumla takes all variables and returns a yardage which would be reported to the user(s)
 
$yards_balance = $off_playchoice - $def_playchoice * ($off_power - $def_power) * rand($minstd,$maxstd);
?>

$yards_balance in this example above is the goal, once we have this we can then build placement of the marker and basically have a game. In the next post we will will also build the user interface and show what this thing really can do.

Football+Simulator+in+php++Part+1%2F3 addthis

Next Page »