Archive
You are currently browsing the archives for the code category.
By mike@mike-miles.com
I had a bit of free time recently, so I began reading up on some of the new API’s that different websites have come out with (Digg, Yelp, etc…). When I found the Yelp API it sparked an idea for a new Drupal module I could build.
Of course I first took a look around the drupal website to see if a module already existed, so I wouldnt waste my time, and suprisingly it did not. Excited I planned out what I wanted to have the module do (after reading Yelp’s extensive restrictions list of what you can/cant do with their API). Since I’ve had alot more practice developing modules since publishing my first one (callouts), I gave myself just 2 days to code, complete and publish this module.
So yesterday (August 12th 2009) I began working on it, and am excited to say I’ve completed the module and it’s just as good as I would of hoped.
Enough of the back story, onto the module itself:
This Module uses the Yelp API to display search results in a block on your site.
The module creates a new block (‘yelp search results’) which you can place on your page from the block administer section.(Administer > Blocks).
For individual site pages (nodes) you can specify settings for the yelp block (Block title, location, search radius, maximum number of results and which yelp categories to search from).So you could display the 5 best rated Hotels near you on one page, and the 10 best bars near you on another page.
Initially the module will just display photo, name, rating, address & phone for each search result. The display of search results is completely themable and provides you with alot of information you can display (such as reviews, longitude & latitude, etc..) for a complete listing of variables available to you open ‘yelp-business.tpl.php’ and view the comments.
There are only 3 draw backs:
- You need a yelp API key to use this module (can get for free from http://www.yelp.com/developers/getting_started/api_access)
- If you have a very high traffic site, the module might stop working (yelp allows you 10,000 API calls per day).
- Per the Yelp API Terms of Use, you have to display the Yelp logo along with your results (the only part that is not themable.)
You can see an example of this module in action at: http://mike-miles.com/drupal/
A few screen shots
 Results Display |
 Editing a Yelp block |
 Listing of Blocks |
|
You can download the drupal module for your drupal site, from its offical module page: http://drupal.org/project/yelp
By mike@mike-miles.com
You might of noticed that I’ve been absent from my blog for a while, well I’ve been very busy. But I’m aback, and hopefully I’ll have some free time to blog more frequently. Ok onto the nitty gritty.
I’ve been spending my free time (the little I’ve had these past few months) working with my pal Josh Milane (www.mittechnical.com) on a twitter website (Which I think is very cool). He’s the brains and I’m the brawn (a.k.a the developer). It’s agreat concept that we’re still improving, but it is good enough where I can blog about it.
The site is www.findAtweeter.com . The site allows you to find tweeters near you (or any location) and mashes it with google maps so that you can see where the tweets are coming from.

findatweeter
It’s built on using the twitter REST API (search API), as well as the google maps API. It’s a great tool if you want to see if any tweeters are interested in the same things as you. We tried to keep the interface as simple as possible, so its easy to search for a variety of tweets, and share those results.

findatweeter search
You might of noticed in that last picture a checkbox for ‘events’. Twitter Events are something we came up with for findatweeter. on findatweeter you can create ‘Twitter Events’, eassentially they are tweets that tell twitter about an event thata going on. For example you might want to create a twitter event for an upcoming party, or convention. Theres alot of uses.

twitter event
Whats great is that findatweeter will post the twitter event to your twitter timeline, so that all your followers can see it. Again, plenty of uses that as I programmer I’m unable to come up with (hence Joshs envolvment in the project).
You can also tweet directly to your twitter account from findatweeter.
Currently www.findatweeter.com is at version 1.5 . I’m working on some minor bug fixes, and looking into using Oauth, so that it can be a registered twitter application. Take a look, some feedback on findatweeter would be great.
Edit: wow, I just noticed i used the word findatweeter alot in this post.
By mike@mike-miles.com
Recently while working on a drupal website for a client, I needed to build in some custom functionality. For drupal this is’nt an issue, basically anything you need to do has been done before and you can find a module in the module directory.
But after searching I was unable to find a module that did what I wanted, so I had to develope one (Which for a nerd like me was really fun). It took me a day or two to build, and refine but I built a module that I was happy with.
The great thing about Drupal is that it’s all open source, and anything built for drupal is covered under the GNU license. Drupal thrives on user submitted content and projects, so I decided I would submit my module to give back to the community. Submitting a module is a bit of a process, you need to submit a proposal, get approved, create an account and create a project page. The Drupal moderators must of liked my module thou, because it was approved!
So I now have my first (hopefully of many) official Drupal module available for download on the Drupal website.
Now for the good part, here is all the info on the module:
Callouts creates a way to display multiple blocks that are related by taxonomy terms. After you place the module into a region on your site, when a user goes to a page any callout blocks (callout is a new content type) with the same taxonomy terms as that page will be displayed in the region.
This Module is great if your looking to show related products in an e-commerence environment, or announcements depending on what page of the site your users are on.
You can downlaod the module for your drupal installation at http://drupal.org/project/callouts
By mike@mike-miles.com
I had a bit of free time over the last week, so I thought I would try my hand at creating a jQuery plugin.
I call it jQuery.fly
What it does is allows you to create some cool animation effects to any text elements on the page, it also has a few built in effect. Useful? not really, but maybe someone will like it.
Some of the built-in effects are:
- bubbles : makes blue bubbles rise from the bottom of the screen
- blizzard: makes it snow on the page
- explosion: creates an explosion on the page
- fire: produces an ASCII fire on the page
Like I said, it’s supposed to be used for text effects, so you could make all the paragraphs on your page randomly move around when a page is loaded.
you can view an example here.
I’ve posted a more in depth description and download links on my projects page, jQuery Fly.