TL;DR — Bypass the database and store the data as flat JSON files. Spend as less time on your target site as possible Basically you don’t want to nest your scraping nor read and write to a database while scraping. Instead you’ll want to scrap small portions of the site into JSON encoded files. Then [...]
Web ScrapingThis was one of the few times I decided to work backwards, which I’m starting to prefer. What I mean is that wrote the below snippet, prior to writing the methods. What this snippet does is retrive all the Venue IDs in our database, then retrieves the corresponding Venue title (post title) and contact email. Simple enough, nothing major. [...]
During the development process you may find your self wanting to “rename” your Custom Post Type. Renaming the post_type is trivial but, if you’ve already added content you’ll find your previous post in accessible. This is because WordPress stores the post_type name in the wp_posts table with each posts. With this nifty function all you [...]
Custom Post TypeIntegrated TinyMCE into the WordPress Plugin I forgot just how easy it was to add TinyMCE. Note, don’t even bother trying to use any WordPress hooks for TinyMCE, just download it, enqueue it, add some code, and then go out and ride. Finally Added a Footer It was fun to do some light design for a change Some gym… [...]
TinyMCEIn an attempt to make our site blazing fast we implemented a 3rd round of optimization this weekend. We installed XCache an opcode server side caching system. The 1st round of optimization was minification and concatenation using YUI and Google’s Closure (the process is automated and integrated into our WordPress plugin framework). The third round was [...]
UnixAs BMX Race Events approaches the end of its beta version I’m finding more time to blog regarding the development life cycle of this side-project. The most recent section that was completed was the Google Maps API v3 integration. I want to note that the content is derived from our JSON feed, all 362 tracks [...]
Custom Post Type, Git, Google MapsTL;DR I create a file called demo_controller.php and then go to site.com/demo/ which loads site.com/wp-content/plugins/my-plugin/views/demo/index.html.php While writing the routes.php file I came across a nifty “trick” to map classes to urls to templates. It saves a hella good time when dev’ing. For example the following urls are actually real files, no pages, no db queries, [...]
While creating the archive template for our Custom Post Types I ran into an unexpected behavior in the built in WordPress search or possibly a small bug. First understand that we are only hooking into WordPress’ search template, we are not using any of the built in searching features of WordPress for various reasons. Second, Events [...]
Custom Post TypeThe end result was simple, on each page reload display a new random image, and a new random callout for an event based on the users current location. I started with one method, which was fairly large, about 100 LOC. All the while my intention was to break out pieces into reusable methods. In the end my [...]
Todays quick “dev sess” consisted of some Facebook Open Graphs, adding a tabbed sidebar, and tweaking the doSearch JavaScript function. All in all I was pleased with the outcome, although Pete spent some time talking to his monitor…