{"id":335,"date":"2010-08-04T15:48:12","date_gmt":"2010-08-04T19:48:12","guid":{"rendered":"http:\/\/www.blogseye.com\/?p=335"},"modified":"2010-08-04T15:48:12","modified_gmt":"2010-08-04T19:48:12","slug":"recent-google-searches","status":"publish","type":"post","link":"http:\/\/blogseye\/2010\/08\/recent-google-searches.html","title":{"rendered":"Recent Google Searches"},"content":{"rendered":"

Someone was trying to hack my Recent Google Searches Widget to work outside of WordPress. This could be used as an include in any web page and when users arrive via google, bing, or yahoo they would see a search that would let them search the site using the same keywords.\u00a0 Since the search engines only give you one link to the best match, this code will give you the rest of the matches.<\/p>\n

I figured out what the person was doing wrong and I generalized the code to work pretty much anywhere that has php.<\/p>\n

You can download the php file and the file I used to test it. rgs.zip<\/a><\/p>\n

You need to include it using a server side include or in php you would enter:<\/p>\n

include(“rgs.php”);<\/p>\n

The history file winds up in a file called history.txt in the form of a serialized array. If you get more than a few hundred hits per minute you might want to use a database to store the data.<\/p>\n","protected":false},"excerpt":{"rendered":"

Someone was trying to hack my Recent Google Searches Widget to work outside of WordPress. This could be used as an include in any web page and when users arrive via google, bing, or yahoo they would see a search that would let them search the site using the same keywords.\u00a0 Since the search engines […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts\/335"}],"collection":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/comments?post=335"}],"version-history":[{"count":0,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts\/335\/revisions"}],"wp:attachment":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/media?parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/categories?post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/tags?post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}