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

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.

Related

How to split a master sheet of email addresses

Ok so the need - I have about 3700 lines of email addresses, names, schools, and professions(those are column headers) I want to split this sheet into 4 with 1000 lines(I understand one will be short) in each but here is the catch I can only have 25 lines/emails from each school. So how would someone go about doing this? Keep in mind each sheet needs to have its own unique emails not repeated on the other sheets.
There are 2 problems here and as I don't know how many schools are on the list and if it's possible to have always less than 25 people from one school (for example - if there are only 30 schools, it would be impossible to distribute them in 1000 row batches).
First task:
Distribute database into 4 sheets, 1000 rows each:
It's simple.
Let's say my data has 4 columns from A to D
I make sheets named 1-1000, 1001-2000, etc.
In each one I put a formula:
1)
=query(Master!A1:D,"select * limit 1000 offset 0")
=query(Master!A1:D,"select * limit 1000 offset 1000")
=query(Master!A1:D,"select * limit 1000 offset 2000")
=query(Master!A1:D,"select * limit 1000 offset 3000")
Etc.
In order to limit number of occurences of each schools, I have to count these occurences and define what is the minimal page number on which this student can be displayed (for example - 17th student from certain school can be on 1st page, but 27th can be at least on 2nd page. 60th student can be on third or further.
When I determine minimal page number, I can sort my data accordingly and display sorted by minimal number:
In this situation my query on next pages have additional parameters:
=query(Master!A1:G,"select A,B,C,D order by G limit 1000 offset 0")
I use column G for sorting, but I don't display it.
You can find my solution here:
https://docs.google.com/spreadsheets/d/1TP6MlMmLiUExOELFhgZnti7LR7VQouMg3h-X7QRcHzQ/copy
Names are generated randomly from polish names generator.

Why can't my Google Sheets Query recognize formula results as numbers?

So I have a formula one one sheet that calculates the difference between the current date (Using the today function) that corresponds to when a repair was requested - this column gives me how many days have passed since the request was made. In a separate sheet, I want to query the requests that are beyond 14 days old but less than 22 days. I write the query as:
Select A,B,C,D,G Where J>14 and J<22
but the cell just displays "N/A". But if I rewrite the code with single quotes on the 14 and 22 as:
Select A,B,C,D,G Where J>'14' and J<'22'
It returns repair requests that are two days old. This tells me that it recognizes the formula results as Strings even if I already set the format to Number.
Can anyone help?
To anyone wondering, I was able to fix this issue by using the VALUE() function (which works for both Google Sheets and MS Excel) which converts any string to numbers.
if J column are dates try:
=INDEX(QUERY({A:G, DAY(J:J)}
"select Col1,Col2,Col3,Col4,Col7
where Col8 > 14
and Col8 < 22")

QlikView count displaying wrong value after using left join script

I have a big excel file containing all data I have since 2 years. But to make comparison, there is a field called IAP which is a number that defines a set of rows into single number according to specific date
Per example, all data collected in December 2016 have an IAP of 34, Data collected in January 2017 is 35, and so on.
In this table I need to compare points from different IAP, that was good and turn to be bad in the last IAP (In this case the IAP 37)
Again, if the Status of a point in IAP 34 is good, and turn to be bad in IAP 37, should be counted.
By creating some excel filters and using VLOOKUPS to count that criteria (again points that was good and turn bad in the last added IAP), the result was 100, but in the QlikView the result displayed in a text object is 60.
Here is the script usign Left Join, in the script editor first:
NewlyBad:
Load
Code As Code1 ,
Status as NewStatus ,
New_Sites as NewNew_Sites,
IAP as IAMP_NAME
Resident ALLIAP
where IAP_Version = $(vMaxIAP) ;
Left Join
Load Code as Code1 ,
Status as OldStatus,
IAP as LAST_IAP
Resident ALLIAP
where IAP_Version = $(vMaxIAMP)-3;
I used this line where IAP_Version = $(vMaxIAMP)-3; to compare data between the last IAP and the IAP-3.
In the variable Overview, I am getting the correct values: comparison between 34 and 37.
Now, the expression of the text object is:
=(count ({< NewStatus={"Bad"}, OldStatus-={"Bad"} >} distinct Code1))
The result displayed is 60 instead of 100, which wrong.

iOS Marvel API: How to get all Characters

Evening, I'm Coding a simple Objective-C app as a request for a school Project.
I have to use the Marvel API to retrieve all the Marvel Characters, ALL of them.
But there is a kind of limit in the API getting the characters, in the beginning I was thinking that there were different pages for the characters list, but than I couldn't find any reference to it.
Than I saw a query parameter named limit: Limit the result set to the specified number of resources.
So I've decided to try with the limit parameter set at his max, 100, and it works, it gets 100 characters. But the characters in total are like 1000.
Without setting the parameter limit I get like 20 characters.
Here is the code I've done so far. I'm Using AFNetworking pod. Github link
Here is the API Doc
Please help me to figure it with is the logic to request all the 1000+ characters from the marvel API.
Sounds like the trick that you'll need to implement is to actually trigger several HTTP requests where the offset parameter is incremented based on the limit requested in the prior requests.
It would look like this:
Request 1: Offset 0, Limit 100
Request 2: Offset 100, Limit 100
Request 3: Offset 200, Limit 100
Request 4: Offset 300, Limit 100
Request 5: Offset 400, Limit 100
Request 6: Offset 500, Limit 100
Request 7: Offset 600, Limit 100
Request 8: Offset 700, Limit 100
Request 9: Offset 800, Limit 100
Request 10: Offset 900, Limit 100
To use the offset idea you just have to put that as a parameter for the query.
So when you call it you, actually, have to call 10 queries with the different offset parameter.
https://gateway.marvel.com/v1/public/characters?ts=yourtsvalue&apikey=publickeyvalue&hash=hashvalue&limit=100&offset=0
https://gateway.marvel.com/v1/public/characters?ts=yourtsvalue&apikey=publickeyvalue&hash=hashvalue&limit=100&offset=100
and so on...

Query to get search result from google ... 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!

Resources