Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] SearchResults: Add custom google search results #5978

Closed
wants to merge 1 commit into from

Conversation

CleverFool77
Copy link
Member

@CleverFool77 CleverFool77 commented Jul 5, 2019

No description provided.

@CleverFool77
Copy link
Member Author

CleverFool77 commented Jul 5, 2019

Hi @jywarren For this addition, I read this answer in my search

No, Google doesn't allow to use their search engine like this. You cannot disguise their service. But you can display the search results in a new tab (see this method) or you could use an iframe element to display google website on your webpage (you will not be able to modify it)

So I went and researched. I saw that If we want the results to be displaced like google, then searchbox is must !!!!
And if we want to do , what we are trying right now. Like doing it without searchbox by getting the query for search from current window url and then passing it search API as parameter. Then we can only do this using JSON API using REST. But that would give the result in json response and then our results wont look like what we have in mockup for google search results in style guide designs. Rather it would titile, info , date etc in card layout from this

/ API callback
hndlr({
 "kind": "customsearch#search",
 "url": {
  "type": "application/json",
  "template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json"
 },
 "queries": {
  "request": [
   {
    "title": "Google Custom Search - cars",
    "totalResults": "1080",
    "searchTerms": "cars",
    "count": 10,
    "startIndex": 1,
    "inputEncoding": "utf8",
    "outputEncoding": "utf8",
    "safe": "off",
    "cx": "008366342703784425914:_p25pf-gy_w"
   }
  ],
  "nextPage": [
   {
    "title": "Google Custom Search - cars",
    "totalResults": "1080",
    "searchTerms": "cars",
    "count": 10,
    "startIndex": 11,
    "inputEncoding": "utf8",
    "outputEncoding": "utf8",
    "safe": "off",
    "cx": "008366342703784425914:_p25pf-gy_w"
   }
  ]
 },
 "context": {
  "title": "PublicLab.org"
 },
 "searchInformation": {
  "searchTime": 0.478101,
  "formattedSearchTime": "0.48",
  "totalResults": "1080",
  "formattedTotalResults": "1,080"
 },
 "items": [
  {
   "kind": "customsearch#result",
   "title": "Public Lab: Could it be used on bikess to understand the air quality ...",
   "htmlTitle": "Public Lab: Could it be used on bikess to understand the air quality ...",
   "link": "https://publiclab.org/notes/fatnotfossils/10-29-2014/could-it-be-used-on-bikess-to-understand-the-air-quality-from-our-precious-machines-cars",
   "displayLink": "publiclab.org",
   "snippet": "Oct 29, 2014 ... Help show the real impacts at a local scale from our car dependent culture and to \nhelp shed light on the air quality issues effecting our children!",
   "htmlSnippet": "Oct 29, 2014 \u003cb\u003e...\u003c/b\u003e Help show the real impacts at a local scale from our \u003cb\u003ecar\u003c/b\u003e dependent culture and to \u003cbr\u003e\nhelp shed light on the air quality issues effecting our children!",
   "cacheId": "JOXyIOqq0toJ",
   "formattedUrl": "https://publiclab.org/.../could-it-be-used-on-bikess-to-understand-the-air- quality-from-our-precious-machines-cars",
   "htmlFormattedUrl": "https://publiclab.org/.../could-it-be-used-on-bikess-to-understand-the-air- quality-from-our-precious-machines-\u003cb\u003ecars\u003c/b\u003e",
   "pagemap": {
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "rdS1YTBD2etW+ebOPBuHE7nkLZ0iKJRCVpmnLk4Zc6YehX+r117bFKCu8udvwMwlagJTBg51LE4HAfnIsFLVwQ==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d",
      "og:title": "Could it be used on bikess to understand the air quality from our precious machines (cars)",
      "og:site_name": "Public Lab",
      "og:url": "publiclab.org/n/11311",
      "og:description": "What I want to do or know\n\nAir quality of my town and differences in air quality at a fine scale ...",
      "og:type": "article",
      "fb:app_id": "644692375883090"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Could it be used on bikes to understand the air quality from cars",
   "htmlTitle": "Could it be used on bikes to understand the air quality from \u003cb\u003ecars\u003c/b\u003e",
   "link": "https://publiclab.org/notes/fatnotfossils/10-29-2014/could-it-be-used-on-bikes-to-understand-the-air-quality-from-cars",
   "displayLink": "publiclab.org",
   "snippet": "Oct 29, 2014 ... Help show the real impacts at a local scale from our car dependent culture and to \nhelp shed light on the air quality issues effecting our children!",
   "htmlSnippet": "Oct 29, 2014 \u003cb\u003e...\u003c/b\u003e Help show the real impacts at a local scale from our \u003cb\u003ecar\u003c/b\u003e dependent culture and to \u003cbr\u003e\nhelp shed light on the air quality issues effecting our children!",
   "cacheId": "nYxfBNZ4RE0J",
   "formattedUrl": "https://publiclab.org/.../could-it-be-used-on-bikes-to-understand-the-air- quality-from-cars",
   "htmlFormattedUrl": "https://publiclab.org/.../could-it-be-used-on-bikes-to-understand-the-air- quality-from-\u003cb\u003ecars\u003c/b\u003e",
   "pagemap": {
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "OiZ4NnrR95MZGtMQWIJPzSs1pRCalRvivhRUcClx22f951PsiI+wUoTsFDRN9DoiVnPTbJPtmGhUG9r4SlERew==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d",
      "og:title": "Could it be used on bikes to understand the air quality from cars",
      "og:site_name": "Public Lab",
      "og:url": "publiclab.org/n/11312",
      "og:description": "What I want to do or know\n\nAir quality of my town and differences in air quality at a fine scale ...",
      "og:type": "article",
      "fb:app_id": "644692375883090"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Public Lab: kathymitchell",
   "htmlTitle": "Public Lab: kathymitchell",
   "link": "https://publiclab.org/p/kathymitchell",
   "displayLink": "publiclab.org",
   "snippet": "kathymitchell 0 research notes and 0 wiki edits | Joined 7 months ago. Cars have \nbecome not only a mode of transport but also a status symbol in the present ...",
   "htmlSnippet": "kathymitchell 0 research notes and 0 wiki edits | Joined 7 months ago. \u003cb\u003eCars\u003c/b\u003e have \u003cbr\u003e\nbecome not only a mode of transport but also a status symbol in the present ...",
   "cacheId": "X2AixJCKh-sJ",
   "formattedUrl": "https://publiclab.org/p/kathymitchell",
   "htmlFormattedUrl": "https://publiclab.org/p/kathymitchell",
   "pagemap": {
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "nPX5Cvrwl1WHIhIbZnMzvO3s0ca7fFIwlBsy7vN1XFhbVDhMnFbkxF2WGrz4GiuZ7GQgpaAd5FTH5PaZNxM0ZQ==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Public Lab: Preparing to map thermal pollution",
   "htmlTitle": "Public Lab: Preparing to map thermal pollution",
   "link": "https://publiclab.org/notes/clairebwmiller/02-04-2014/preparing-to-map-thermal-pollution",
   "displayLink": "publiclab.org",
   "snippet": "Yesterday, myself and Jeff hooked up a laptop to a thermal camera- connected \nthem both to my car's cigarette lighter- and went for a drive. You can see the ...",
   "htmlSnippet": "Yesterday, myself and Jeff hooked up a laptop to a thermal camera- connected \u003cbr\u003e\nthem both to my \u003cb\u003ecar's\u003c/b\u003e cigarette lighter- and went for a drive. You can see the ...",
   "cacheId": "mTKGl8Y-WNsJ",
   "formattedUrl": "https://publiclab.org/notes/.../preparing-to-map-thermal-pollution",
   "htmlFormattedUrl": "https://publiclab.org/notes/.../preparing-to-map-thermal-pollution",
   "pagemap": {
    "cse_thumbnail": [
     {
      "width": "259",
      "height": "194",
      "src": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTJrKodoMJr4S1jK7YCB8vpqcJK0aS3I4w-TZxj4R4eVuhQXAycV2Z4mrw"
     }
    ],
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "jtWdG6hJZg3cEPT7IunvUAfbVGD8xoo/R8wSJdG4DLkE/QOEavWFt+uncK4KVrpQF003d0tGyqo1uLf77K0AuA==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d",
      "og:title": "Preparing to map thermal pollution",
      "og:site_name": "Public Lab",
      "og:url": "publiclab.org/n/10010",
      "og:description": "The goal of this project is to have an image of thermal water pollution.\nYesterday, myself and Je...",
      "og:type": "article",
      "fb:app_id": "644692375883090",
      "og:image": "/system/images/photos/000/002/766/medium/IMG_20140203_203151.jpg"
     }
    ],
    "cse_image": [
     {
      "src": "https://publiclab.org/system/images/photos/000/002/766/original/IMG_20140203_203151.jpg"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Public Lab: What can YOU do?",
   "htmlTitle": "Public Lab: What can YOU do?",
   "link": "https://publiclab.org/notes/msmelody/08-07-2013/what-can-you-do",
   "displayLink": "publiclab.org",
   "snippet": "Aug 7, 2013 ... People should use less cars ,and we should ride bikes more than cars ,because \nbike don't damage the earth like cars do . We can us cars but ...",
   "htmlSnippet": "Aug 7, 2013 \u003cb\u003e...\u003c/b\u003e People should use less \u003cb\u003ecars\u003c/b\u003e ,and we should ride bikes more than \u003cb\u003ecars\u003c/b\u003e ,because \u003cbr\u003e\nbike don't damage the earth like \u003cb\u003ecars\u003c/b\u003e do . We can us \u003cb\u003ecars\u003c/b\u003e but ...",
   "cacheId": "q6dpDxz5wDwJ",
   "formattedUrl": "https://publiclab.org/notes/msmelody/08-07.../what-can-you-do",
   "htmlFormattedUrl": "https://publiclab.org/notes/msmelody/08-07.../what-can-you-do",
   "pagemap": {
    "cse_thumbnail": [
     {
      "width": "259",
      "height": "194",
      "src": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRypc7F93cdaPeTfhmvpZtGNEYRbSRwmiXSAi3bCFVhxMGGw6NsnEN1mM8"
     }
    ],
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "2qcGsEJ52t4olRp83QmCdgw/jOsLZax0kFcMshMWS833hV6HV5FwJLgre/slrINe2CmWvMlRtHN0FjwoQLwvyw==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d",
      "og:title": "What can YOU do?",
      "og:site_name": "Public Lab",
      "og:url": "publiclab.org/n/8978",
      "og:description": "Our team has been brainstorming what we can do to help improve air quality of our neighborhood. C...",
      "og:type": "article",
      "fb:app_id": "644692375883090",
      "og:image": "/system/images/photos/000/001/059/original/AQE_mainphoto"
     }
    ],
    "cse_image": [
     {
      "src": "https://publiclab.org/system/images/photos/000/001/059/original/AQE_mainphoto"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Chicago Car Keys - MapKnitter",
   "htmlTitle": "Chicago Car Keys - MapKnitter",
   "link": "https://mapknitter.org/maps/chicago-car-keys",
   "displayLink": "mapknitter.org",
   "snippet": "We are your Chicago lost key expert - We replace lost keys, Make extra car key \nduplicates, Fix car ignition problems, Do emergency lockout services, Broken key\n ...",
   "htmlSnippet": "We are your Chicago lost key expert - We replace lost keys, Make extra \u003cb\u003ecar\u003c/b\u003e key \u003cbr\u003e\nduplicates, Fix \u003cb\u003ecar\u003c/b\u003e ignition problems, Do emergency lockout services, Broken key\u003cbr\u003e\n ...",
   "cacheId": "RZtTyTYfvVoJ",
   "formattedUrl": "https://mapknitter.org/maps/chicago-car-keys",
   "htmlFormattedUrl": "https://mapknitter.org/maps/chicago-\u003cb\u003ecar\u003c/b\u003e-keys",
   "pagemap": {
    "cse_thumbnail": [
     {
      "width": "120",
      "height": "120",
      "src": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSr4OcpcI8gmXbmzfLKC1S9JSQRxtwrq_n_G6dZJoYeAJLmSug4bJplhA"
     }
    ],
    "metatags": [
     {
      "csrf-param": "authenticity_token",
      "csrf-token": "/auMcjKp1HkRht9Dv7II6zLc2Hw3n75iTmuzixWm1To=",
      "viewport": "width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
     }
    ],
    "cse_image": [
     {
      "src": "http://il.usalocalbd.com/media/8200885/logo/thumb/8200885.jpg"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Public Lab: Kinect for 3d mapping from a car",
   "htmlTitle": "Public Lab: Kinect for 3d mapping from a \u003cb\u003ecar\u003c/b\u003e",
   "link": "https://publiclab.org/notes/warren/1-24-2011/kinect-3d-mapping-car",
   "displayLink": "publiclab.org",
   "snippet": "Jan 24, 2011 ... http://blog.decoratorpattern.com/2011/01/23/real-world-mapping-with-the-kinect/ I\n've been wonder...",
   "htmlSnippet": "Jan 24, 2011 \u003cb\u003e...\u003c/b\u003e http://blog.decoratorpattern.com/2011/01/23/real-world-mapping-with-the-kinect/ I\u003cbr\u003e\n've been wonder...",
   "cacheId": "gDb09lqi4sEJ",
   "formattedUrl": "https://publiclab.org/notes/warren/1-24.../kinect-3d-mapping-car",
   "htmlFormattedUrl": "https://publiclab.org/notes/warren/1-24.../kinect-3d-mapping-\u003cb\u003ecar\u003c/b\u003e",
   "pagemap": {
    "cse_thumbnail": [
     {
      "width": "310",
      "height": "163",
      "src": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSEUaLDU5f6Xyyt0LbXQD7NtujJKGd2Cf5laKKmwr-8_kDl4JXafL3yFxo"
     }
    ],
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "XYEWSjyIyITJ6n9bv+LVYFx+IvhBB3sg5IPA7Pmi2up5hfaGyj32udf1WiDqX+m0NcJC8s4+Wc4IENLZClunrA==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d",
      "og:title": "Kinect for 3d mapping from a car",
      "og:site_name": "Public Lab",
      "og:url": "publiclab.org/n/58",
      "og:description": "http://blog.decoratorpattern.com/2011/01/23/real-world-mapping-with-the-kinect/\n\nI've been wonder...",
      "og:type": "article",
      "fb:app_id": "644692375883090",
      "og:image": "/sites/default/files/imagecache/default/screen-shot-2011-01-22-at-10-24-19-pm.png"
     }
    ],
    "cse_image": [
     {
      "src": "https://publiclab.org/sites/default/files/imagecache/default/screen-shot-2011-01-22-at-10-24-19-pm.png"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Public Lab: adrienne2242",
   "htmlTitle": "Public Lab: adrienne2242",
   "link": "https://publiclab.org/profile/adrienne2242",
   "displayLink": "publiclab.org",
   "snippet": "adrienne2242 0 research notes and 0 wiki edits. Volvo Cars` Hakan Samuelsson \nIntvd on Bloomberg TV. HAKAN SAMUELSSON, CEO, VOLVO CARS, ...",
   "htmlSnippet": "adrienne2242 0 research notes and 0 wiki edits. Volvo \u003cb\u003eCars\u003c/b\u003e` Hakan Samuelsson \u003cbr\u003e\nIntvd on Bloomberg TV. HAKAN SAMUELSSON, CEO, VOLVO \u003cb\u003eCARS\u003c/b\u003e, ...",
   "cacheId": "rlLTHwTEMqYJ",
   "formattedUrl": "https://publiclab.org/profile/adrienne2242",
   "htmlFormattedUrl": "https://publiclab.org/profile/adrienne2242",
   "pagemap": {
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "03ZS7dR1fMmxn0OnQxvdOgHB6+qkfFXZhW07G72KGLTohaeofEtFF9sRdxLHpJ57JRMvrH8BzCPA5V/2U5tdOA==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Public Lab: Oil testing Kit: Collection of Samples from Pavement ...",
   "htmlTitle": "Public Lab: Oil testing Kit: Collection of Samples from Pavement ...",
   "link": "https://publiclab.org/notes/ernestootero/10-25-2015/oil-testing-kit-collection-of-samples-from-pavement-boqueron-puerto-rico",
   "displayLink": "publiclab.org",
   "snippet": "Oct 25, 2015 ... Collection of Unknown Samples I decided to test paved areas showing residues \nfrom cars. I did tha...",
   "htmlSnippet": "Oct 25, 2015 \u003cb\u003e...\u003c/b\u003e Collection of Unknown Samples I decided to test paved areas showing residues \u003cbr\u003e\nfrom \u003cb\u003ecars\u003c/b\u003e. I did tha...",
   "cacheId": "2lbqEKNSdBIJ",
   "formattedUrl": "https://publiclab.org/.../oil-testing-kit-collection-of-samples-from-pavement- boqueron-puerto-rico",
   "htmlFormattedUrl": "https://publiclab.org/.../oil-testing-kit-collection-of-samples-from-pavement- boqueron-puerto-rico",
   "pagemap": {
    "cse_thumbnail": [
     {
      "width": "259",
      "height": "194",
      "src": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTR4CWWkDcRj6eBFzMRwCKoxX49ppEL36X4gLmNG9OFlFkIz73h4kZrWPE"
     }
    ],
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "QezBB+BoaHt5YYPes9sZbo81Htr2w3g3bdI2LivArqdw4Y+JFObtljsqUcM9Gz6yn+DhtsbFMSTJbjl1VGBI/A==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d",
      "og:title": "Oil testing Kit: Collection of Samples from Pavement, Boqueron Puerto Rico",
      "og:site_name": "Public Lab",
      "og:url": "publiclab.org/n/12334",
      "og:description": "Collection of Unknown Samples\nI decided to test paved areas showing residues from cars. I did tha...",
      "og:type": "article",
      "fb:app_id": "644692375883090",
      "og:image": "/system/images/photos/000/012/163/medium/20151025_105936.jpg"
     }
    ],
    "cse_image": [
     {
      "src": "https://publiclab.org/system/images/photos/000/012/163/original/20151025_105936.jpg"
     }
    ]
   }
  },
  {
   "kind": "customsearch#result",
   "title": "Public Lab: Tracking Oil Trains Using RFIDs",
   "htmlTitle": "Public Lab: Tracking Oil Trains Using RFIDs",
   "link": "https://publiclab.org/notes/tonyc/08-20-2015/tracking-oil-trains-using-rfids",
   "displayLink": "publiclab.org",
   "snippet": "Aug 20, 2015 ... logs all RFID numbers of trains passing by a sensor; captures video of any cars \nthat are not already in the system (compares RFID to a list of ...",
   "htmlSnippet": "Aug 20, 2015 \u003cb\u003e...\u003c/b\u003e logs all RFID numbers of trains passing by a sensor; captures video of any \u003cb\u003ecars\u003c/b\u003e \u003cbr\u003e\nthat are not already in the system (compares RFID to a list of ...",
   "cacheId": "LITG4Kc0qi8J",
   "formattedUrl": "https://publiclab.org/notes/tonyc/08.../tracking-oil-trains-using-rfids",
   "htmlFormattedUrl": "https://publiclab.org/notes/tonyc/08.../tracking-oil-trains-using-rfids",
   "pagemap": {
    "cse_thumbnail": [
     {
      "width": "275",
      "height": "183",
      "src": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRSttzm0XjzbBl1DKKRzu3hNrbV-bO1iTJ7FMhm-qYlTyFeEmgKUmtlckKD"
     }
    ],
    "metatags": [
     {
      "viewport": "width=device-width, initial-scale=1.0",
      "author": "Public Lab contributors",
      "csrf-param": "authenticity_token",
      "csrf-token": "8sj8+9eD5Z6raOz68XwTtvu6zUQBam5cyI93QKyyT8BuWI+UYcIXmDfDhv1Esm0dzsSXPXvTTqe5bjh24jPXUA==",
      "google-translate-customization": "4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d",
      "og:title": "Tracking Oil Trains Using RFIDs",
      "og:site_name": "Public Lab",
      "og:url": "publiclab.org/n/12159",
      "og:description": "I want to start a conversation about how an open hardware/software project could help track the m...",
      "og:type": "article",
      "fb:app_id": "644692375883090",
      "og:image": "/system/images/photos/000/011/221/medium/800px-BNSF_eastbound_oil_train_in_Bad_Rock_Canyon.jpg"
     }
    ],
    "cse_image": [
     {
      "src": "https://publiclab.org/system/images/photos/000/011/221/large/800px-BNSF_eastbound_oil_train_in_Bad_Rock_Canyon.jpg"
     }
    ]
   }
  }
 ]
}
);

We can do make this json response to look like google result. But for that we have to add lot new more lines of code too. It would lots of styling and many other stuff to make the data look like google result.

@jywarren
Copy link
Member

jywarren commented Jul 5, 2019

Hi! So, for this, we can just do exactly what we're doing on https://publiclab.org/w/search -- See the code here:

https://publiclab.org/notes/raw/19093

No need at this point to try to hide the input or anything. I think it works for now! Once this is in place, we can work some follow-ups!

@jywarren
Copy link
Member

jywarren commented Jul 5, 2019

Hmm, wonder why this didn't generate screenshots? But, in changing the search page we may have to change the tests that confirm its interface.

@CleverFool77
Copy link
Member Author

CleverFool77 commented Jul 6, 2019

Hi Jeff !!!!!
So what you mean is to do this ?
ss attached 👍
Screenshot from 2019-07-06 16-29-15

I just addded the lines you provided in the code.

@jywarren
Copy link
Member

jywarren commented Jul 6, 2019 via email

@CleverFool77
Copy link
Member Author

So you mean when I search test on searchbox for custom google like this ?

gg

or did you mean that as soon as we got /search/test url after typing some test on searchbar of navbar , then we should get google results first ? and internal results should be given only when we press by type. But As I said above, Isn't it necessary to use google's searchbox to show the google results.

@jywarren
Copy link
Member

jywarren commented Jul 6, 2019 via email

@CleverFool77
Copy link
Member Author

Damn !!!! I finallyy get itttttttttttttttttttt !! 🎉
Hi Jeff. I understood what you were trying to say. I'll implement this.
Thanks !!

@jywarren
Copy link
Member

jywarren commented Jul 6, 2019

I'm so sorry I was being so hard to understand!!!

@CleverFool77
Copy link
Member Author

I'm so sorry I was being so hard to understand!!!

Nooo !! It was me who wasn't able to understand !!!

@jywarren
Copy link
Member

Hi, just checking in on this! How is it going? Thanks!

@CleverFool77
Copy link
Member Author

CleverFool77 commented Jul 24, 2019 via email

@jywarren
Copy link
Member

jywarren commented Aug 2, 2019

I'm catching up today but if this got finished can you link to the final pr? Thank you!!!

@CleverFool77
Copy link
Member Author

CleverFool77 commented Aug 2, 2019 via email

@CleverFool77
Copy link
Member Author

CleverFool77 commented Aug 2, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants