CodeIgniter Rightmove V3 .blm Data Feed Parser Library
About The .blm Data Feed Format
Initially introduced by Rightmove, the .blm (Bulk Load Mass) data feed format for transferring property data has become somewhat of an industry standard. If you’ve had any interaction with working on a property website there’s a high chance you will have come into contact with it at some point.
Sending properties and constructing a feed is simple enough, but what if you need to parse a .blm feed. Maybe you’re building your own property portal or building an estate agent website that receives properties from a third party in this format. If so it can be challenging and time consuming to extract the data correctly, perform the relevant lookups, move images etc.
Introducing the CodeIgniter Library
This library will take a .blm file, or a ZIP file that includes the .blm, extract the data, move the images, floorplans etc to the specified directories, perform lookups on fields such as the property type, and will even archive it if required to a separate folder. The library is easy to use and I’ve also included extensive debugging so that you can see exactly where the issue lies should one arise. The result is an array of properties that you can then do with what you wish.
Downloading the Library
You can download the library by clicking the link below:
The dowloaded ZIP file includes three files:
Rightmove_v3_parser.php – This file is the brains of the operation and is where all the magic happens. Simply place this straight into the ‘libraries’ folder of your application directory.
Unzip.php – This file is required if the .blm data feed and media will be provided in a zip. Again, place this file into the ‘libraries’ folder of your application directory.
sample.blm – A sample file to test the library.
Putting it into Action
Once the libraries have been put into place you’re ready to rock. I have included below a simple example to be placed in a controller that loads the library, sets a few optional parameters and processes the files:
// Load the library $this->load->library('rightmove_v3_parser'); // Set any required parameters // file_name - (optional) // If it is a specific file that you are looking to get processed // enter the filename here. Can be a .blm or ZIP file. If no // filename is provided the library will use the last modified //file in the directory specified by the file_location parameter $config['file_name'] = ''; // file_location - (optional) // The directory where the files to be processed reside. If // blank the root directory shall be used $config['file_location'] = ''; // image_destination - (optional) // floorplan_destination - (optional) // document_destination - (optional) // epc_destination - (optional) // hip_destination - (optional) // The directories where the various media should be moved // to. If blank the media will not be moved $config['image_destination'] = 'images'; $config['floorplan_destination'] = 'floorplans'; $config['document_destination'] = 'documents'; $config['epc_destination'] = 'epcs'; $config['hip_destination'] = 'hips'; // archive_location - (optional) // If specified, the processed file will be moved here once // processing is completed $config['archive_location'] = 'archived'; // Initialize the library $this->rightmove_v3_parser->initialize($config); // Process the data feed and return the properties as an array $data['properties'] = $this->rightmove_v3_parser->process(); // For debugging purposes output the results echo $this->rightmove_v3_parser->print_debugger(); // Output the properties that have been processed print_r($data['properties']);
So there we have it. A whole data feed parsed in just a few lines of code. Please leave any feedback, bugs or change requests via the comments box below. Enjoy!