{"id":3189,"date":"2023-11-05T18:27:31","date_gmt":"2023-11-06T03:27:31","guid":{"rendered":"https:\/\/crm270s.wordpress.com\/?p=3189"},"modified":"2023-11-05T18:27:31","modified_gmt":"2023-11-06T03:27:31","slug":"google-map-business-link-from-firefox-extraction-perl","status":"publish","type":"post","link":"https:\/\/crm270s.mycpamytax.com\/?p=3189","title":{"rendered":"Google Map Business Link from Firefox Extraction Perl"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>use strict;\nuse warnings;\n\n# Initialize variables to store extracted URLs\nmy @google_maps_urls;\n\n# Process each HTML file (1.html to 25.html)\nfor my $file_number (1..25) {\n    my $input_file = \"${file_number}.html\";\n\n    # Open the current input file for reading\n    open my $input_fh, '&lt;', $input_file or warn \"Cannot open input file '$input_file': $!\";\n\n    # Read each line and look for URLs\n    while (my $line = &lt;$input_fh&gt;) {\n        chomp $line;\n        if ($line =~ \/https:\\\/\\\/www\\.google\\.com\\\/maps\\\/place\/) {\n            # Remove leading '&lt;' and trailing '&gt;'\n            $line =~ s\/^&lt;(.+)&gt;$\/$1\/;\n            push @google_maps_urls, $line;\n        }\n    }\n\n    # Close the current input file\n    close $input_fh;\n}\n\n# Save the extracted URLs to a file\nmy $output_file = 'extracted.txt';\nopen my $output_fh, '&gt;', $output_file or die \"Cannot open output file '$output_file': $!\";\n\nforeach my $url (@google_maps_urls) {\n    print $output_fh \"$url\\n\";\n}\n\n# Close the output file\nclose $output_fh;\n\nprint \"Extraction complete. Extracted URLs are saved in '$output_file'\\n\";\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[26],"tags":[],"class_list":["post-3189","post","type-post","status-publish","format-standard","hentry","category-codes"],"_links":{"self":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/posts\/3189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3189"}],"version-history":[{"count":0,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=\/wp\/v2\/posts\/3189\/revisions"}],"wp:attachment":[{"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crm270s.mycpamytax.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}