Archive for the 'MapsKrieg' Category

Page 2 of 4

Craigslist and Google Maps Mashup Thingy: Day 12+13 – Dot Com and Cities

So I worked on the mashup quite a bit yesterday. So much that when I was done, I was too tired to write a blog entry about it. I mostly spent yesterday buying the domain name, upgrading my server, and getting the project to work on my “production” server. It wasn’t too difficult; I just needed to move the database, change some names, and make sure there weren’t any old names being used. I also started adding all of the cities on CraigsList to the database. At least, the US ones.

This took a lot of time to do manually. I had to figure out if the area was an actual city, or a bunch of cities, then figure out the geo coordinates, and stuff it into the database. I thought it might be faster to do it by hand than write a script. Nope.

Today I wrote a script that would make the entry faster by automagically getting the coordinates from Google Maps’ http request service. It still took a while, but today I finished inserting almost all of the US cities (excluding the combination ones, since Google can’t do those).

Now all that’s left is for me to make the pop up windows a little prettier, and maybe add a list of the CraigsList listings to the side for easy browsing by price, # of bedrooms, etc. That shouldn’t take too long. Then I can launch the site!

Craigslist and Google Maps Mashup Thingy: Day 11 – More Random Code

Today for the mashup thing, I did a bit of work on the main index page where each available city will show up as a marker. So when someone goes to the root of the website, they’ll see a bunch of cities. They can also pick the cities from a drop down menu, too. This required a bit of more javascript and some template files, etc.

I did a little research on the person who did the Google Maps Craigslist mashup like two years ago. Apparently he got a job at Google! While that’s pretty awesome, I can’t see this project doing the same for me, since it’s something that’s already been done (and two years ago, which is an eternity in web time). Rather, I’m just building this for my own use and perhaps for other people who wish there were more cities available in that HousingMaps mashup.

I came up with a name for the application. I was going to call it CraigsMaps, but someone already has that domain name. I’m thinking I should buy the domain name pretty soon, but what if I come up with a cooler name later!? The app should be ready in a couple of days anyway. Depending on how much extra stuff I want to cram in before I “launch” it.

Craigslist and Google Maps Mashup Thingy: Day 10 – Custom Controls and Housekeeping

I guess this should count as the project’s 10th and 11th day, though I didn’t really spend too much time on either day, so let’s just roll them into one. After doing some CSS to overlay some divs over the Google Map, I found out there’s another way to do this: with “custom controls.”

The way that the custom controls work is both pretty sweet, and not that great. I don’t like having to add content to them by using javascript. It just doesn’t seem “correct” to do so, since I’m just overlaying normal html. So I’ll be using some custom controls, and some divs. The good thing about custom controls is that the map knows not to open infowindows under them when they’re opened up.

Besides that, I just did a lot of random work on getting the app to look a little better. Like showing the correct area based on which city’s listing you want to see. Overall, the project is coming along really smoothly, with very few roadblocks. I’m happy that it’s nearing completion. I really enjoy doing these one-man projects, since it lets me get experience in everything from database schema planning and optimizing, to php backend development, to designing the css for the content, and even maybe a little tweaking in the Apache server. I think once I add this project to my “real” server, I’ll need to get a ram upgrade.

I think the project should probably be ready to go live within a week. I dunno if I’ll actually try to get the word out, or just release it and see if people find it via Google or something. That’d be cool. Since there’s already a site that does a similar thing (though there’s a smaller number of supported cities), I don’t think what I’m doing is really that noteworthy. I think it’d be useful, though, so we’ll see if there’s any reaction at all to it.

Craigslist and Google Maps Mashup Thingy: Day 9 – CSS Foo and CakePHP Helpers

Today I did a bunch of CSS, making the mashup thing actually look kind of nice. Later, I may add some more “Web 2.0″ features such as drop shadows and gradients. I was having a hard time getting the map to show up in the div with a few of the css layouts I downloaded, so I just decided to code it by hand. I think it looks pretty neat; the map stretches across the whole screen and then the other content is shown in absolutely positioned divs.

I also did some stuff with the CakePHP helpers. CakePHP’s inferiority to Rails is really starting to show to me. I think it’s all a product of PHP having not been created for this kind of MVC design. CakePHP tries to follow the conventions of Rails, but it does so in a sort of copycat manner. As such, the result does not meet or exceed the original.

In the case of Helpers, Rails automagically links the named helper to the controller. In CakePHP, you must specify that a certain controller uses a certain helper. It’s kind of annoying. There also isn’t any support for the Rails convention of “partials,” which is why I’m using their helpers to begin with… It’s annoying.

Also, I find it annoying that CakePHP finds an objects associated objects by default when using “find()” or “findAll().” It’s useful when I want it, but when I don’t, it wastes a lot of memory! Now that I think of it, I’m not sure if Rails does this by default or not. The only reason I mention it is because I kept getting out of memory errors (or more accurately, memory limit errors) with my application. It’s a big waste when all I want is the name of the area and CakePHP fetches ALL of the associated listings for that area…

I must sound really whiny right now. I guess it’s just from some frustration in learning a new language/framework instead of using one that I’m used to. It’s good for me, I won’t argue against that. It’s just a bit disappointing to see all of these flaws when a framework is purported to be things like “stable” and “good.”

Oh, and also, I should say that I think my actual mashup is coming along pretty nicely. It should be ready in a few more “days,” where a “day” is one I am actively working on the mashup. I could probably “release” it pretty soon, but usually when I release something, it means I won’t work on it much anymore, moving to something else I find interesting. So I should probably actually have it done before I release it…

Craigslist and Google Maps Mashup Thingy: Day 8 – CakePHP Routing and Caching

I spent a whole lotta time today trying to get caching working with CakePHP. Apparently, CakePHP doesn’t do caching quite as gracefully as Rails when it comes to custom routing, especially in the application root. Yeah, there’s a bug. I thought I was doing something wrong though, so it took me forever to find out it was actually a bug (or is it a “feature?”).

Besides that, I got the interface to what it was previously, except with AJAX so that the Craigslist images are only downloaded when you click on a map marker. I also found that it takes a long time to put a week’s worth of listings (from Ann Arbor, at least) onto the map at once. I’m guessing there were at least 400 on there. I made a hard limit to the number of listings that show up, and it loads a lot faster now.

I’m sort of back into the mood for working on this project again. I finally beat the Scrin campaign (it was really short) in Command and Conquer 3, so I’ll definitely be more focused now. I think.

Books

Hung Truong's  book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists

Capitalism!