Buying Getting Google SafeSearch to work with Google CSE

Discussion in 'Programming' started by Suziclue, Jan 19, 2015.

  1. #1
    Hi,

    I'm trying to understand Google's instruction on how to make my Google CSE to display only Google Safesearch results. I'm willing to pay $5 for the first person to review this page and tell me what to plug into my Google CSE code. Just post your advice and if it works, I will pay you the $5.

    This is the document and my code is below: Tell me exactly where to plug the recommended code into. Thanks

    https://developers.google.com/custom-search/docs/element

    <script>
    (function() {
    var cx = '00440449146423xxxxxx:wo1qgu___ha';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
    '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
    })();
    </script>
    <gcse:search></gcse:search>
     
    Suziclue, Jan 19, 2015 IP
  2. JamieH

    JamieH Well-Known Member

    Messages:
    975
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    140
    Digital Goods:
    1
    Articles:
    1
    As Seller:
    100% - 1
    As Buyer:
    100% - 0
    #2
    I'm guessing you would need to include the attribute "webSearchSafesearch".

    So where you have this line of code at the bottom "<gcse:search></gcse:search>"

    Try changing it to <gcse:search webSearchSafesearch="active"></gcse:search>

    I haven't used the product before so I wouldn't be able to tell you otherwise. But from reading that doc you would just include that attribute.

    Jamie
     
    JamieH, Jan 19, 2015 IP
  3. Suziclue

    Suziclue Well-Known Member

    Messages:
    524
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    125
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    Great Job. You solved it for me!! Message me your paypal address.
     
    Suziclue, Jan 19, 2015 IP
    JamieH likes this.