Query to get search result from google ... iOS - ios

i am developing an app in iOS to search any word in google search engine ,,,,
currently i am using this url to retrive the results which will be returned in JSON form
http://ajax.googleapis.com/ajax/services/search/web?num=100&v=1.0&q=
where q is the key word to search about it ,,,
the problem is every time i am trying to search it just return 4 results ,,, how i can increase the results to more than 4 ,,,
and another thing ,, how to access the result pages like 1 2 3 ... in the url (i think its a parameter in the same url).
thanks ..

The arguments you're looking for are:
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&gl=de&q=test&rsz=8&start=5
/ /
result set size (1-8) /
/
page offset
For more, see the corresponding documentation.
Also, keep in mind that this API is deprecated!

Related

Web Scraping Google-Sheets ImportXML - xpath - specific Number in URL

I am trying to get a specific Number from an URL, which is hyperlinked on the website.
Please see here a copy of my spreadsheet.
In Row "I" - i did a code, so it will directly go the the search of the eBay website, and combines the EAN number ="https://www.ebay.de/sch/i.html?_from=R40&_trksid=m570.l1313&_nkw="&""&D2
this is the outcome:
https://www.ebay.de/sch/i.html?_from=R40&_trksid=m570.l1313&_nkw=8713439712292
Till here it works.
On the page, i want the ebay Kategorie ID for that articel, which can be found as a Hyperlink on the Categories [See Image of eBay Categorie here] Navigation on the left.
In the URl it is always the first Number, eg. https://www.ebay.de/sch/**158817**/i.html?_from=R40&_nkw=650135421227
InspectCode URL I need
All I want know, is to put the Number 158817 in my google spreadsheet.
With this code
=IMPORTXML(I2;"//*[#id='x-refine__group__0']/ul/li/ul/li/ul")
I only get the categorie name, but I need the number to make my CSV upload work.
What code do I need? Can Someone please guide me?
thank you
Lisa
With A1 = https://www.ebay.de/sch/**158817**/i.html?_from=R40&_nkw=650135421227, try this
=regexextract(IMPORTXML(A1;"//*[#id='x-refine__group__0']/ul/li/ul/li/ul/li/a/#href");"[0-9]+")
assuming that the url is always at the same position in the nomenclature
or, to get all numbers
=arrayformula(regexextract(IMPORTXML(A1;"//*[#id='x-refine__group__0']/ul/li//a/#href");"[0-9]+"))

How to get only one resut from =IMPORTXML "/GeocodeResponse//location" in google spreadsheets?

I am using
=IMPORTXML("https://maps.googleapis.com/maps/api/geocode/xml?key=A***s="&CONCATENATE(F17&", "&G17&", "&H17&", "&I17), "/GeocodeResponse//location")
with google spreadsheet to geocode address to lat lon coordinates. And sometimes I get
#REF! Array result was not expanded because it would overwrite data in J18
As I understand there is more than one result and it needs 2 rows instead of 1. Is it possible to return only one result?
I tried using
=IMPORTXML("https://maps.googleapis.com/maps/api/geocode/xml?key=As="&CONCATENATE(F17&", "&G17&", "&H17&", "&I17), "/GeocodeResponse//location[1]")
but sometimes it works and sometimes not.
Thanks
You first need to see what is the output, and based on that, use INDEX function to pinpoint and filter the value returned
It would look like this if the data is in 2nd row, 1st column:
=INDEX(IMPORTXML("https://maps.googleapis.com/maps/api/geocode/xml?key=A***s="&CONCATENATE(F17&", "&G17&", "&H17&", "&I17), "/GeocodeResponse//location"), 2, 1)
Reference:
INDEX

Google spreadsheet: Value parameter can not be parsed for number

I'm using this script to integrate price change inside my google sheet. The command I'm performing is:
=VALUE(Right((Index(ImportHtml("http://bigcharts.marketwatch.com/quickchart/quickchart.asp?symb="&B5&"", "table"),3,2)),7))
Where B5 contains: BTOU and this is the value I got returned.
As a result I see following error:
VALUE parameter ': +0.02' cannot be parsed to number.
Would be much appreciated for the help.
You can use another Right() to get the last 5 digits.
=Value(Right(Right((Index(ImportHtml("http://bigcharts.marketwatch.com/quickchart/quickchart.asp?symb="&B5&"", "table"),3,2)),7),5))
I had been using this formula for years.
After trial and error this one works. It just changed the 7 and the end to a 6. Dont ask me why!
=VALUE(Right((Index(ImportHtml(CONCATENATE("http://bigcharts.marketwatch.com/advchart/frames/frames.asp?symb=",B5,"&insttype=Fund"), "table"),3,1)),6))

Add suffix to a decimal row (to show litres)

I'm using Eureka Forms for swift 2 and I'm trying to add a Suffix to a DecimalRow. My the reason is that in this row the user will enter the amount of litre consumed, so I would like the row to display the L at the end all the time
I did not find anything in the API docs to help me with this....
Thanks

how to get yahoo search result according to page number in YQL/pipes?

we can get only the first 10 urls result using
select url from search.web where
query="stackoverflow"
how can i get results accorridng to page numbers like result from 60 to 70, or 90 to 100 and son on..??
The answer to your question is:
SELECT url FROM search.web(0,60) WHERE query="stackoverflow"
Replace 60 with whatever other number your desire. Max is 500 afaik for the search.web YQL table because that is the limit of Yahoo BOSS which is used in this table.
You can also replace the 0 with e.g. 10, to skip the first 10 results. So using search.web(10,60) would still give you 60 results while skipping the first 10.
Also see the YQL documentation on remote limits - thats how this search.web(0,60) syntax is called.

Resources