Using the TBS (or equivalent parameter) in Google Custom Search - google-custom-search

When using Google Custom Search the TBM parameter for selecting specific types of search engines (e.g. tbm=pts for patents or tbm=blg for blogs) seems to be supported even though this isn't properly documented in the list of parameters.
However when using such "special" searches one usually extend the query by using the TBS parameter, unfortunately this doesn't work for me. For example:
https://www.google.com/?tbm=pts&gws_rd=ssl#q=touch+screen&tbas=0&tbs=ptss:g,ptso:us&tbm=pts
filters correctly when posted from a browser.
But the equivalent custom search:
https://www.googleapis.com/customsearch/v1?key=*MY_KEY*&cx=*MY_ENGINE*&tbm=pts&q=lice+comb&tbs=ptss:g
Completely ignores the TBS parameter.
Is there a way to specify an equivalent parameter in custom search?

Set image search on in the Control Panel to generate a separate Image tab (can set to default). If you're editing an existing CSE, it's under Search Features in left-hand column, then click Imagesearch Settings. You can edit settings, but specifying image type (e.g., Faces) isn't one of them - also see https://support.google.com/customsearch/answer/2630972?hl=en&ref_topic=4513743 and https://support.google.com/customsearch/answer/3037004?hl=en&topic=3036698
If you want to do additional things like that, you're probably better off creating a series of bookmarklets (easily shareable with a free tool like https://w-shadow.com/bookmarklet-combiner/ ) or via your own JS-enhanced webpage where you can build in all those parameters.

Related

Implementing JSon-LD Schema in Ektron, is it possible?

This is my first time using Ektron and i'm trying to implement Json-LD schema scripts for each page. I have 68 scripts that I need to implement that are unique for each page.
I thought I would be able to implement these scripts through meta data, but now i'm unsure. Each script is over 1000 characters, the html and meta tag types only allow 500 characters, so i'm assuming i'm in the wrong place. If anyone could shed some light it would be much appreciated.
Ektron's metadata isn't intended for large chunks of data / content. So, yes, you will find limits there.
Here are two things you might try as workarounds.
Most direct:
Use the Ektron Library. Go to the Library tab and click on the Root node and view Properties. Add an extension to allow you to upload your JSON-LD as a file. Use metadata on the content item to reference the uploaded file. Combine the two upon output.
If you want the JSON-LD to be editable within the CMS...
Gaming the platform a bit
Create a new SmartForm definition and include in it a single plain-text, multi-line field (not Rich text). This should hold your JSON-LD. Set up a folder and, if your version supports it (you didn't specify CMS version, so I will assume relatively recent), set the folder to be non-searchable so these things don't come up in site search results. Add a restriction to the folder to only allow the Smart Form definition you just created. Create your JSON-LD there using the plain-text field. You should be able to store up to 1MB.
Same as above, add your JSON-LD as text then use a reference to this item from the content you want to use it.
The metadata in this case (and possibly the library one, though I'd have to test and I don't have an Ektron environment for development anymore) will give you the Content ID for the object holding your JSON-LD. You'll have to make another API call but will give you the solution you appear to want from above.

Get output of a template call in a page from MediaWiki API

I am trying to parse a page on a wikia to get additional information for a Infobox Book template that is on the page. The problem is the I can only get the template's source instead of the transformed template on the page.
I'm using the following url as a base:
http://starwars.wikia.com/api.php?format=xml&action=expandtemplates&text={{Infobox%20Book}}&generatexml=1
The documentation doesn't really tell me how to point it to a specific page and parse the transformed template from the page. Is this even possible or do I need to parse it all myself?
To expand a template with the parameters from a given page, you will have to provide those parameters. There is no way for the API to know how the template is used in different pages (it could even be used twice!).
This works:
action=expandtemplates&text={{Infobox Book|book name=Lost Tribe of the Sith: Skyborn}}
You will, of course have to keep adding all the parameters you want to parse (there are 14 in your example).
If you have templates that change automatically depending on which page they are (that is not the case here), e.g. by making use of magic words such as {{PAGENAME}}, you can add &page=Lost_Tribe_of_the_Sith:_Skyborn to your API call, to set the context the template should be expanded in.
If you to not know the parameters given, you can either:
Render the whole page with index.php?action=render&title=Lost_Tribe_of_the_Sith:_Skyborn, and parse the returned html to carve out the actual infobox
Fetch (action=query&prop=revisions) and parse the wikicode to get the parameters to the template, and supply them to the expandtemplates call
Start using an extension like Semantic MediaWiki, that allows you to treat your wiki more like a database
1 and 2 can go wrong in any number of ways, of course, as with a wiki you have, by definition, no way of knowing that the content is always entered in a consistent way.

custom google search autosuggestion

I have created a custom google search application for my website.
Below is the url
https://www.google.com/cse/
to create application.
Under the Auto complete section i have enabled autocomplete,but still it dont suggest me the options when i start typing on search box.
It suggest me only the keywords that We define under custom autocompletions.
SO my question is : Do we need to provide all the custom keywords that we want to autocomplete in search box or google just creates its own autosuggestion from the website ?
It creates autosuggestions from the website, but it may take few days to collect all data. It also takes into account user's queries on your website.
As previous answer suggests, autocomplete can take a few days to begin working. In addition you must specify one or more specific sites / pages to which to restrict the custom search engine. On occasion, you may also have to specify that the CSE only search those site(s) / page(s) instead of simply emphasizing them in the results.

Generate a URL to Rally objects using FormattedID?

I would like to write web pages that have links to Rally issues (Test Cases, Defects, etc). I would like to be able to generate a URL with the FormattedID. Is this possible? Or do I really need the objectID? For example:
http://rally1.rallydev.com/363953481d/detail/testcase/TC1665
(or something like that, instead of the cryptic object id)
The following allows users to go directly to the detail page of a work product without having to know the Object ID:
https://rally1.rallydev.com/#/search?keywords=US1234
This relies on a feature of Rally's search functionality and isn't officially supported - so the above URL isn't guaranteed to work forever. However it's a decent way to use Formatted ID's as a workaround.
Searching by just keyword will give you the item with that ID and related items (e.g. other items that mention the desired ID in their name). Sometimes this is fine, sometimes not.
To search for DE75700 and DE72760 only, and no others use
https://rally1.rallydev.com/#/search?keywords=FormattedID%3ADE75700%20FormattedID%3ADE72760
This is equivalent to manually typing
FormattedID:DE75700 FormattedID:DE72760
in the Rally search box.
As a corollary to the main answer I have defined a Chrome browser bookmark which will take me right to any Rally item by its ID.
The URL for this bookmark in full is:
javascript:(function(){window.location = "https://rally1.rallydev.com/#/search?keywords=" + prompt("Enter ID:");})();
When this bookmark is activated, it prompts you like so:
I find this to be a huge time saver.
Thanks to Displaying a prompt from javascript Chrome bookmark.

Sharepoint 2010 dropdown list search

I'm working to create a search center in Sharepoint 2010. I was curious if its possible to have (ideally several) dropdown lists which present options and contribute to a search. Any ideas? Thanks
3 options:
1) Use the search refiners, though these will only appear after the initial search, and do not allow blank searches.
2) Configure the advanced search page to allow custom modifiers. These are found after the advanced link on the search page, and do allow blank searches.
3) Write a custom web part that pre-caches the search refiners / custom modifiers, and shows them as potential possibilities on the default search page. I have written one of these recently, so it is certainly possible, though it did take a bit of time and requires a supporting timer job (to determine the cached potential search options). If you'd like to buy it from my company, I'm sure they'd be willing to sell it : )