Category Archives: Code

Submitting Hyp3rL0cal for CityGrid Usage Requirements Compliance

When I built Hyp3rL0cal I wanted it to be a working example of how developers could build local directories using CityGrid Places and Advertising API. Since I want developers to be able to take the local directory prototype and deploy for themselves, I wanted to bring it as close to compliance with CityGrid usage requirements as I could.

To do this, I submitted Hyp3rL0cal for review by our partner account management team, to receive feedback on how to bring my local directory into compliance.

For the places search results page:

For the places detail page:

  • Ads Display - You can only display ads on profile pages for businesses that are non-advertisers. For example: You can view Katana’s Places Detail API response. You’ll notice an attribute that states “false”– this means you cannot display an ad for this business’ profile page. For businesses that are non-advertisers, their attribute will state “true”.
  • Customer Message Attribution - You need to provide the proper attribution for Customer Message. 
  • Optional ‘Profile URL’ - Since you have all of the required content displayed on your own profile page, you don’t need to display the ‘Profile URL’ which re-directs to Citysearch’s profile page.
  • Offer or Link – The Offer is not displaying correctly. If it may be difficult to get the full offer displayed correctly, you can choose to just display the link to view the full Offer. Our Usage Requirements give you the option to display either the entire offer or link.
  • Impression Tracker - In order for us to track impressions on your profile pages, you must implement our Places that Pay Impression Tracker. Please keep in mind that action targets must be user initiated. For example: You can fire the action target listing_profile when a user clicks on a business from the Search Results Page and is taken to the Profile page which displays all Places Detail API information. You can then set Javascript on-click events for the other action targets displayed on your Profile Page – such as listing_website, offer, listing_map and etc.
  • Footer attribution -  For all pages with CityGrid content – Under 3.8 Attribution in our Usage Requirements, the proper Footer Attribution must state the following: “Powered by CityGrid; Data from Infogroup ©[YEAR]” .
  • Search bar - Building a search bar in your directory increases user interaction and enables them open access to finding places they’re interested in.
  • Prominent Links -Make your links more prominent so that users are more apt to click on them. For instance, you can create buttons for “Menu”, “Email”, “View Website” and etc. instead of text links.Here are some examples:

I just went through all this feedback and updated the Hyp3rL0cal PHP directory, and then updated the Github repository. The only two things I did not implement was the Mapping URL and Impression Tracker.  I will make two separate posts out of this, much like I did with displaying ads on CtyGrid places detail pages.

I will work to update the Python and Ruby Hyp3rL0cal prototypes as well as the WordPress local directory when I can.  Hopefully we can some plug and play starter kits that are immediately compliant with CityGrid usage requirements, as soon as you install.

Hyp3r0cal for WordPress

I wanted a way to make the rich content available via CityGrid APIs accessible to anyone, even if you weren’t a developer.

CityGrid has some great iOS and Android software development kits (SDK) available for building local, mobile applications.  I’ve also built some samples and starter kits for building local web applications in PHP, Python and Ruby.

WordPress seemed like the perfect next step to reach a larger audience, so I took the PHP Hyp3rL0cal directory that uses CityGrid Places API, and deployed it as a WordPress Plugin.

Now you can launch a quick section on your WordPress blog or site that allows you to display businesses for your area, in whatever category you wish.

This CityGrid Hyp3rL0cal WordPress Plugin is meant to be a project that developers can learn from and even deploy their own local WordPress Plugins that use CityGrid APIs.  However its completely functional and could be deployed by any non-developer as well.

Right now you can download or fork at Github, as I stabilize it further I will publish to the CityGrid developer center code samples page.

If you have any questions or need help, visit the CityGrid Developer Forums or ping us on Twitter via @citygridapiteam.

New CityGrid PHP, Python and Ruby Code Samples and Hackathon AMIs

We just published a new CityGrid API code samples page that  I’ve been working on.  We’ve had a page for the iPhone and Android SDK for a while, but I wanted to make sure we had some code samples and starter kits to help developers to quickly deploy web applications.

There are now PHP, Python and Ruby code samples you can download or fork.  There is also a local web directory I built using Twitter Bootstrap, which is available in PHP, Python and Ruby.

I developed the local directory starter kits, and code samples on an Amazon EC2 instance running Linux.   After I make any changes to the samples or starter kits, I just create a new AMI for each language, and make it public, for anyone to use.  You should take one of the AMI for a test drive, and let me know if you want to see any other APIs or tools on them, I will consider adding to the bundle.

I will keep working on new code samples and starter kits.  After I get them published to the CityGrid Github account, I will update the code samples page in the CityGrid Developer Center.