Help for this page

Select Code to Download


  1. or download this
    # modules for easier debugging and
    # better coding standards
    use warnings;
    use diagnostics;
    use strict;
    
  2. or download this
    # URL that returns list of YBX categories
    my $category_list_http = qw !http://api.yellowbrix.com/api/?service=ca
    +tegory_list&method=xml&id=verizon&pass­word=xxxxxx!;
    
  3. or download this
    my $url = qq!http://api.yellowbrix.com/api/?!;
    my $common = qq!method=xml&id=verizon&pass­word=xxxxxx;!
    ...
    
    # URL to weather on yellowbrix server. weather query must be appended.
    my $weather_http = $url . qq!service=weather&$common&query=!;
    
  4. or download this
    # mySQL escape character
    my $sql_escape_char = '\\';
    ...
    $data{pub_source} =~ s/(')/$sql_escape_char'/gs;
    $data{headline} =~ s/(')/$sql_escape_char'/gs;
    $data{summary} =~ s/(')/$sql_escape_char'/gs;
    
  5. or download this
    sqlStatement ('INSERT articles ('.
                                    'story_id,'.
    ...
                            "'$article_data{summary}',".
                            "'$article_data{summary_url}'".
                            ')');
    
  6. or download this
    $article_data{summary_url} = "some stuff \'); drop table articles;";
    
  7. or download this
    sqlConnectToDB;
    sqlStatement ("TRUNCATE TABLE articles");
    ...
    
    # retrieve xml file with all articles
    my $headline_xml = getHTTPAddress($category_http_start.uri_escape($cat
    +egory_name).$category_http_end);