I have just finished a little experiment testing the feasibility to scrape a standard Drupal website. Before I unleash my foolishness upon you, allow me to introduce the matter...
Drupal is a world famous open-source content management system in PHP for websites big and small. At ONE Agency, we use Drupal to create almost everything: e-commerce websites, social network websites, web applications, you name it. And not supprisingly, we've used Drupal to provide dynamic data feeds for rich internet applications as well. For RIAs, we install AMFPHP as a custom service module and this allows us to call views and service methods built with Drupal from Flash/Flex over this open-source "Flash remoting" gateway for PHP. And this works neatly.
Now personally, I know very little about Drupal, not to mention that I know nothing about customizing a Drupal installation. And all of a sudden, I had a little crazy idea (while having in mind this other little crazy project where I built a website in Flash + custom CMS in Flex, PHP & MySQL)... I wanted to find out if a Drupal website could easily be scraped. FYI: the act of website scraping is to crawl through the (X)HTML of webpages to extract certain data of interest. Drupal websites are in XHTML, which is XML basically. With E4X in ActionScript 3, parsing and accessing XML data is a breeze.
Finally, to explain my little experiment... First, I installed Drupal 6.6 on this Infomaniak website account in a few minutes (after reading the getting started PDF), and it's right here. Then I quickly threw in some test data. More specifically, I made a simple hierarchical menu with some page content behind the menu items. Then, I made a Flex project to load the menu and to display the content behind the menu items: check it out here (view source). In the first column, we have a tree component representing the menu. When you select a leaf, the corresponding node is displayed in the TextArea.
"What's the use?", you might ask. Well, it was a fun experiment. To know about how to do things properly using the services via AMFPHP: check out this "howto".
Also, check out these screencasts about Drupal services and how to use them in Flex:


One Comment
Thanks , great post to learn how to use PureMVC with Flex