Mobile::Wurfl

A Perl module interface to WURFL (the Wireless Universal Resource File
Download

Mobile::Wurfl Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ave Wrigley
  • Publisher web site:
  • http://search.cpan.org/~awrigley/

Mobile::Wurfl Tags


Mobile::Wurfl Description

A Perl module interface to WURFL (the Wireless Universal Resource File Mobile::Wurfl is a Perl module interface to WURFL (the Wireless Universal Resource File.SYNOPSIS my $wurfl = Mobile::Wurfl->new( wurfl_home => "/path/to/wurfl/home", db_descriptor => "DBI:mysql:database=wurfl:host=localhost", db_username => 'wurfl', db_password => 'wurfl', wurfl_url => q{} ); my $dbh = DBI->connect( $db_descriptor, $db_username, $db_password ); my $wurfl = Mobile::Wurfl->new( dbh => $dbh ); my $desc = $wurfl->get( 'db_descriptor' ); $wurfl->set( wurfl_home => "/another/path" ); $wurfl->create_tables( $sql ); $wurfl->update(); $wurfl->get_wurfl(); $wurfl->rebuild_tables(); my @devices = $wurfl->devices(); for my $device ( @devices ) { print "$device->{user_agent} : $device->{id}n"; } my @groups = $wurfl->groups(); my @capabilities = $wurfl->capabilities(); for my $group ( @groups ) { @capabilities = $wurfl->capabilities( $group ); } my $ua = $wurfl->canonical_ua( "SonyEricssonK750i/R1J Browser/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1" ); my $deviceid = $wurfl->deviceid( $ua ); my $wml_1_3 = $wurfl->lookup( $ua, "wml_1_3" ); print "$wml_1_3->{name} = $wml_1_3->{value} : in $wml_1_3->{group}n"; my $fell_back_to = wml_1_3->{deviceid}; my $width = $wurfl->lookup_value( $ua, "max_image_height", no_fall_back => 1 ); $wurfl->cleanup();Mobile::Wurfl is a perl module that provides an interface to mobile device information represented in wurfl (). The Mobile::Wurfl module works by saving this device information in a database (preferably mysql).It offers an interface to create the relevant database tables from a SQL file containing "CREATE TABLE" statements (a sample is provided with the distribution). It also provides a method for updating the data in the database from the wurfl.xml file hosted at http://www.nusho.it/wurfl/dl.php?t=d&f=wurfl.xml.It provides methods to query the database for lists of capabilities, and groups of capabilities. It also provides a method for generating a "canonical" user agent string (see "canonical_ua").Finally, it provides a method for looking up values for particular capability / user agent combinations. By default, this makes use of the hierarchical "fallback" structure of wurfl to lookup capabilities fallback devices if these capabilities are not defined for the requested device. Requirements: · Perl


Mobile::Wurfl Related Software