Search Youtube and return JSON - json

Is there a url I can use the search for 'foo' on YouTube, and return JSON with a list of videos?

As their API docs clearly state, just add ?alt=json:
http://gdata.youtube.com/feeds/api/videos?q=foo&alt=json

The YouTube JSON API Page can help you out.
Some research on the API Page points out that http://gdata.youtube.com/feeds/api/videos?q=foo&alt=json is all you need...

On latest update:
https://www.googleapis.com/youtube/v3/search?part=snippet&q=SEARCHPARAMATER&maxResults=25&key=key
By using this URL you will be able to give the search parameter and get the desired JSON.

Related

IMPORTHTML() doesn't work in this webpage

I want to import data from a table from the following page:
https://basketballmonster.com/playerrankings.aspx
When I do so, with all players filter selected, only the top players are imported to my googlesheet. Can someone help me achieve this? Appreciation in advance.
I attached the googlesheet below for your review:
https://docs.google.com/spreadsheets/d/1uvhNp6gBnnEvs8CBb4K7onccew_doFp96wmFEsYyLBk/edit?usp=sharing
Google Sheets can't know what your browser has, so it doesn't know whether you selected which filter. You have to get the same html for Sheets that you have displayed in your browser, which means adding the filter in your query.
Since it looks like the controls aren't passed as parameters in a GET request, sadly it's not as simple as appending
?PlayerFilterControl=TopPlayers to the url.
You have to POST it as a payload with a post request like
{ 'PlayerFilterControl': 'AllPlayers'}.
Sadly Google Sheets IMPORTHTML() doesn't support post request yet, so you'll have to get into apps scripts, request and xml parsing.
I suggest you check out these:
https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app
https://developers.google.com/apps-script/reference/xml-service

Vimeo URL I've never seen before with two different IDS. How do I get it to work with one?

I have this Vimeo URL.
https://vimeo.com/192207770/0faf1dd09d
I don't understand what the two IDS represent and how I can shorten it into a single ID URL.
All other vimeo URLs I've seen are vimeo.com/<id>
What do these two IDS signify in this order? Where is the unique video ID I can address with vimeo.com/<id>?
That URL is an unlisted video. Unlisted videos are only playable by viewers with the full URL (https://vimeo.com/[video_id]/[unlisted_hash]) and are not returned in Vimeo search results.
Video privacy settings are outlined here: https://help.vimeo.com/hc/en-us/articles/224817847-Privacy-settings-overview
In general, an unlisted video will have a uri like this:
"uri":"/[video_id]:[unlisted_hash]"
However, it's best practice to get that uri from the API, instead of building it yourself. You can get the video's uri and metadata by making this request:
GET https://api.vimeo.com/videos?links=https://vimeo.com/[video_id]/[unlisted_hash]
Finally, for unlisted videos you must have the unlisted_hash to get its metadata or to view it on vimeo.com. For an unlisted video with the url https://vimeo.com/1234567/abcde, both vimeo.com and the API will return 404 for https://vimeo.com/1234567.
I hope this information helps!
Just wanted to note that in my case when using an unlisted video, I simply omitted the last segment of that url when sending a videoID to my player SDK.
In your case it would simply be the video id of 192207770

Scrape CSS to bulk-check responsiveness

I have a list of web domains and would like to check if they are built to be mobile-responsive. A fairly sure way to check this manually is to see if there are "#media" queries in the style.css.
I've used XPATH (IMPORTXML) previously to bulk-check for strings on webpages, but I don't see an obvious way of importing the css files in bulk and search for a string within them. Is there a way to do this? Ideally, I'd like to accomplish it in Google Sheets or with Google Apps Script.
Thank you!
You can use Google's Mobile-Friendly Test if you want to use a GUI.
If you want to use a REST API, try this (replace url parameter for what you want to test):
https://www.googleapis.com/pagespeedonline/v3beta1/mobileReady?url=http://facebook.com
This will return a JSON object. It will return lots of useful info, but if you are just looking for mobile friendliness, look for the true or false result here:
"ruleGroups": {
"USABILITY": {
"pass": true
}
Hope that helps!

Google's autocomplete in my form

I have a form on my website which forwards the textbox input to www.google.com/search?q=.... Is there any possibility to get this autocomplete / autofill features google provides when searching over google.com. Firefox uses google's autocomplete function in the search bar next to the url bar, but how can I get this kind of information for my web form?
There was the Google Suggest API that allowed to use autocomplete on custom keywords. But it seems google has removed it. But I found out that you can still access the API. There are URLs for JSON and XML.
JSON
http://clients1.google.com/complete/search?hl=en&q=<your query here>&client=hp
XML
http://clients1.google.com/complete/search?hl=en&q=<your query here>&output=toolbar
Without any warranty.
If you want to get autocomplete on a text box. You can combine that with jQuery UI Autocomplete
Here an complete example with google auto suggest
http://googlesuggest-jquery.googlecode.com/svn/trunk/
The new url is:
http://suggestqueries.google.com/complete/search?client=firefox&q=YOURQUERY
the client part is required; I did't test other clients.
In addition to RickyA´s answer you can filter the suggestion by media using bs parameter:
http://clients1.google.com/complete/search?hl=en&q=stackoverflow&output=toolbar&ds=
youtube: ds=yt
books: ds=bo
products: ds=sh
news: ds=n
images: ds=i
web: ds=
recipes: ds=r

How to load Additional Pages for Twitter Hashtag Search using JSON

I'm using the Twitter URL: http://search.twitter.com/search.json?q=%23test in order to return a JSON list of tweets with the hash tag #Test.
It returns 15 results and says page 1. How do I load the next page of 15 tweets?
*I tried adding &page=2 to the search URL, but no luck.
The JSON response of the URI you posted includes the query parameters to use to get the next page. It's in the "next_page" element. Currently, the value is "?page=2&max_id=80076124637499392&q=%23test". So, the complete URI for the second page is http://search.twitter.com/search.json?page=2&max_id=80076124637499392&q=%23test
The Twitter search API documentation unfortunately does not describe how to use this parameter, though it is briefly described in the Twitter API Wiki at http://apiwiki.twitter.com/w/page/22554664/Return-Values.