Youtube XML search API provides description of the video without any highlight - youtube-api

I am using youtube ATOM xml to retrieve search results related to search terms -
http://gdata.youtube.com/feeds/api/videos?v=2&max-results=10&q=obscure+search+terms&safeSearch=moderate&oi=spell&start-index=1&spell=1
The XML has description for each video but the description does not have any keyword highlighting. For example, if I search for 'soccer', I expect all the word that has 'soccer' in it, to be highlighted by using some tag on the returned XML. Is there any way to get it ?

No, there's not. What does "highlighting" even mean in this context--there's no standard way of representing "highlighting" in XML, so if you're talking about a <b> tag around the search term, that only would be a viable solution for developers who plan on displaying the result in a HTML page. If they did anything else with the result, like display it in a native mobile app, the <b> would be meaningless noise.
In the past, there have been a few instances where search results were being returned with <b> tags around the search terms, but those were bugs, and they all should have been resolved.

Related

Can youtubes Markdown syntax be escaped?

I'm trying to use literal double dash: -- in youtube video description, and youtube's markdown formats subsequent text as strikethrough.
Note: the issue occurs when there are multiple occurances of strings containing --.
I've tried some common markdown escaping methods, suh as:
\--string
```--string```
To no avail, and with the nature of google and youtube every search I could concieve resulted in videos of markdown use in other languages. The only slightly relevent things I could find were guides on how to format text, none of which had information regarding escaping.

Show just a sample of text in search results

I'm using ReactiveSearch (great Search UI library!) and am trying to figure out how I can just show a ample of a text article in the ReactiveList search results. Currently it shows the whole article but I just want the first 250 words or so to be displayed.
I just want say the first 250 words of that. Is that possible with ReactiveList? If so, how can I go about doing that or is there a feature o setting that I'm missing with ReactiveSearch?
This is the simple line that displays it currently:
<p className="card-text">{data.Text}</p>
It is possible to truncate the text after a few lines. But ReactiveSearch doesn't support this feature on the library level.
You can achieve this by using the package called react-truncate. You can read the documentation here.
Hope this helps!

md-highlight-text for multiple words

I am using md-highlight-text to highlight words in a list of checkbox-labels based on search. But I want to highlight multiple words searched.. There is no option/flag for this in the directive?
Code example from md site:
<input placeholder="Enter a search term..." ng-model="searchTerm" type="text">
<ul>
<li ng-repeat="result in results" md-highlight-text="searchTerm">
{{result.text}}
</li>
</ul>
here I want to highlight multiple words typed in the input.
Because I found this in my top search result on the web, and because the question was a bit unclear, I'm going to answer this multiple ways.
Of course, as mentioned in lorenzo montanan's answer, you do need to provide some css for the highlight (I think so, at least).
If the OP (or you, the reader) was asking to highlight multiple words in the results, there is now a md-highlight-flags which could help (see md-highlight-text documentation) which currently works like this:
md-highlight-flags - string - A list of flags (loosely based on JavaScript RexExp flags).
Supported flags:
g: Find all matches within the provided text
i: Ignore case when searching for matches
$: Only match if the text ends with the search term
^: Only match if the text begins with the search term
If, however, you want to type in multiple words in the input and have the output highlight each word separately without having to be in the same order, then md-highlight-text will not, and is not interested in doing that (see: request for highlighting multiple input words and another request). One way to do that is to write your own filter directive.

Youtube API v3 : no wildcard in search?

I'm making a list of the videos of my channel, and want to use the search endpoint of the API : https://developers.google.com/youtube/v3/docs/search/list
Ther eis a "q" parameter to send the query. What completely bugs me is that no wildcard is referenced in the documentation, and when using * it doesn't do anything. For example, in order to find any video containing "television" in the title, the full word has to be input ! Sending "tel" won't work, nor sending "televisio".
Did I miss something ? Is there a way around this ?
Thanks !
YouTube searching works along the same paradigm as Google searching, which is quite a bit different than the character-wildcard keyword approach. It's semantic probabilistic searching, looking for relevance based on the terms you give it, so while the * does represent a wildcard, it represents a whole word. For example, you can search for "a * saved" and it will return to you the videos which score the highest relevance score where any word could be substituted in place of your wildcard.
You can also use other punctuation based search operators ... the + sign, - sign, quotation marks, etc. Just make sure they're all URL encoded before you send the query in.

character entity not showing in google search

I'm using &hairsp; on my page, encoding is UTF-8, no BOM. Works pretty well even in other search engine, but the excerpt, Google is showing for my page contains a visible
&hairsp;
code. Is there something, I can do against it?
Apparently Google does not recognize the &hairsp; entity reference; you didn’t provide a URL, but it was rather simple to confirm the observation, searching with "hairsp" (with quotes).
The way around this bug is to use the numeric character reference &#x200a or the character U+200A HAIR SPACE itself.
You might also consider using other methods for creating added spacing, such as the padding properties in CSS. They are more flexible than the fixed-width spaces.

Resources