{"id":27473,"date":"2009-11-02T11:07:05","date_gmt":"2009-11-02T11:07:05","guid":{"rendered":"http:\/\/scienceblogs.com\/gregladen\/2009\/11\/02\/software-needed-enhanced-web-s\/"},"modified":"2009-11-02T11:07:05","modified_gmt":"2009-11-02T11:07:05","slug":"software-needed-enhanced-web-s","status":"publish","type":"post","link":"https:\/\/gregladen.com\/blog\/2009\/11\/02\/software-needed-enhanced-web-s\/","title":{"rendered":"Software Needed: Enhanced web search"},"content":{"rendered":"<p>Google is great, and yes, I know all those tricks that make it greater. But I still want to use REGEX in some cases.  So, I figured out a way to do that, in theory, all I need now is the code&#8230;<br \/>\n<!--more--><br \/>\nBriefly, the software I need, which I shall call googlereg for now, feeds the harvest from a google search through a regex filter and produces a list of hits.<\/p>\n<p>There are three streams of data that could be fed through the regex filter:  The basic output of the Google search (what you see as results on a Google search page), the actual pages found by the Google search, and the entire site at the domain found by Google.  The first is quick and will only allow limited contact between the regex filter and the web site, the second is more effective (obviously) but would take a long time and is web-noxious and poor behavior if applied to a large number of sites.  The third option is probably redundant because presumably Google has already checked those pages for your Google search term, but the ability to do this should be built in just in case.<\/p>\n<p>So, the following parameters would be used to make the search work and to adjust its behavior:<\/p>\n<p><em>googleterm:<\/em> The Google search term that generates a preliminary list of sites.<\/p>\n<p><em>regex:<\/em> The regular expression that is designed to test the results<\/p>\n<p><em>nsall:<\/em> The number of total sites (a page and all its links on the same domain) to search and test with the regex.  Default is zero, and one would rarely if ever want to set it to a larger number.<\/p>\n<p><em>npage:<\/em> The number of pages found by the google search to completely search and test with the regex<\/p>\n<p><em>nsum:<\/em> the number of summaries of hits (from the google search) that is tested with the regex.<\/p>\n<p>The data streams, the, are the googlestream, sitestream, and pagestream.  To make this work they would need to be pre-filtered to isolate groups of text to test associated with a specific URL.  Furthermore, it would be cool if blogs produced by commonly used software (Movable Type, WordPress, etc.) were also processed to strip out headers, footers, and sidebars.  Beyond this, the remaining text would ideally be stripped of newlines so they don&#8217;t have to be messed with, with hyphen\/newline combos turned into nothing, and newlines otherwise converted to spaces. And so on.<\/p>\n<p>So typing this at the command line:<\/p>\n<blockquote><p>\ngooglereg -b googleterm regex npage nsum nall <\/p><\/blockquote>\n<p>&#8230;eventually opens up a browser window with web page titles (as links) with the Google summary below, and below that a 200 character (configurable) context with the regex embedded in the middle.  If -b was left off the results go to standard output.  Cool parameters like -o for ouput file and -i for input file could also be useful.<\/p>\n<p>This is probably doable as a perl one-liner.  What do you think?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google is great, and yes, I know all those tricks that make it greater. But I still want to use REGEX in some cases. So, I figured out a way to do that, in theory, all I need now is the code&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"1","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[67,4893,57],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5fhV1-797","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts\/27473"}],"collection":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/comments?post=27473"}],"version-history":[{"count":0,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/posts\/27473\/revisions"}],"wp:attachment":[{"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/media?parent=27473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/categories?post=27473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregladen.com\/blog\/wp-json\/wp\/v2\/tags?post=27473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}