0

Hi i want to filter the explicit images when i run my application(in local and server). how to i restrict the images which are containing adult images what should i do for restrict images using google custom search engine please anyone help me.

i am using below code but its not working.

 <script type="text/javascript">


        google.load('search', '1');

        function initialize() {

            var searchControl = new google.search.SearchControl();          
            searchControl.addSearcher(new google.search.ImageSearch());
            searchControl.draw(document.getElementById("searchcontrol"));
            searchControl.execute("sunset");
        }
        google.setOnLoadCallback(initialize);
</script>
Kara
  • 6,115
  • 16
  • 50
  • 57
user1969032
  • 1
  • 1
  • 1
  • 3
  • What has this to do with appengine? This is client javascript code and is consuming google search service which has nothing to do with appegine. – Tim Hoffman Feb 11 '13 at 13:55
  • i want to implement safe search filteration-ON in my application once it is published on server. – user1969032 Feb 12 '13 at 07:00

1 Answers1

0

You can use following code from this guide

var searcher = new google.search.ImageSearch();
searcher.setRestriction(
google.search.Search.RESTRICT_SAFESEARCH,
google.search.Search.SAFESEARCH_STRICT);

imageSearch.setSearchCompleteCallback ...
imageSearch.execute....

Also notice:

  1. Adult filtering works only for few languages (please see it here)

  2. This API marked as deprecated. Probably in future you should use some sort of this API. I am still using deprecated API, but in any time Google can disable this one.

Dmytro Kutetskyi
  • 701
  • 6
  • 11