Showing posts with label HOWTO. Show all posts
Showing posts with label HOWTO. Show all posts

Wednesday, 8 June 2016

HOW TO use Bing Search v5 API with JavaScript

Taking off from the single basic JavaScript sample on the newly minted version 5 of Bing Search API, I put together a couple of samples of my own. You'll have to sign-up for a free key from Microsoft Cognitive Services to replace in the code samples to try them & also experiment with all the other APIs that are available



Bing Search API gets not just web search results but also image, news, & videos results for a given query and allows up to 1,000 free transactions per month across all Bing Search APIs

Google Custom Search API has a few additional steps & provides 100 search queries per day for free

This comparison of version 2 and 5 highlights the improvements -
Category Featurev2v5
Web SearchREST API xx
Related searchesxx
Ranked Answers
(image, video, news, math, time)
x
Deep links (for first web page result)x
Adult intent signalx
Image SearchREST API xx
Enhanced filters: image size, license, stylex
Visually similar images and productsx
Merchant and recipe sources
(for product and food images)
x
Trending imagesx
Entity recognition (for people)x
Computer-generated captionsx
Video SearchREST API xx
Video previews (motion thumbnails)x
Enhanced video metadata
(creator, resolution, view count)
x
Free / Paid video filterx
Trending videosx
News searchREST API xx
News articles by category or marketxx
Trending news (general or by category)x
Enhanced article metadata, including featured entities
Spell CheckREST API x
Autosuggest REST APIx
GeneralLocation and market awarenessxx
Spelling suggestions xx
Safe searchxx
Related searchesxx
Continuous relevance improvementsx
Ongoing support and feature improvementsx

Related: Google vs. Microsoft Bing Search APIs: A Detailed Comparison

Saturday, 12 March 2016

HOW TO scan a barcode with Android smartphone camera from a web page

If you need a barcode to be scanned from a mobile web app & then get back the code as text from the scanner, the ZXing ("Zebra Crossing") open-source, multi-format 1D/2D barcode image processing library & ZXing Barcode Scanner can help.

Note that this web page will only work when opened within an Android browser & smartphone with camera having ZXing Barcode Scanner installed

Here are the steps for a simple demo:
1. Create a webpage to initiate the bar code scanner through anchor tag.

When the ZXing Barcode Scanner application is installed on an Android device, a URL call to: zxing://scan/?ret=http://example.azurewebsites.net/desc.html?code={CODE}
..will bring up the device bar code reader so that the user can scans the code. The code is returned via the callback URL parameter supplied in the zxing URL.
2. ZXing Barcode Scanner will present the code to the file desc.html. To show that the code is in fact returned, I use a document.write(location.href); to show the returned barcode text

Saturday, 6 February 2016

HOW TO filter columns in a HTML table within any web page

There are multiple ways to filter columns in a HTML table within any web page

1. Google Sheet can be used to scrape tabular data.

For example, by using the IMPORTHTML formula in a cell within Google Sheet it is possible to scrape the tabular data from this Wikipedia article link:
=IMPORTHTML("http://en.wikipedia.org/wiki/Demographics_of_India", "table", 4)
The table referred in the formula is the fourth among the tables on the web page referred by the URL.

Once you have the data within Google Sheet, you can filter by column value (select column header, choose Filter from Data menu) or hide column (select column, choose Hide column from context menu)

Mediawiki, the open-source wiki application that Wikipedia is based on makes it simple to make a table's columns sortable by just including the value "sortable" in the CSS class attribute for that table.

2. Stoyan Stefanov's ReactiveTable bookmarklet can work on any table (that has table header row cells enclosed within a TH tag) within any web pages including those that need to be authenticated. His blog post has instructions on how to use his bookmarklet to act upon tables to sort, filter as-you-type, download the data in CSV and JSON formats.

Wednesday, 18 November 2015

HOW TO invoke a Chrome App / Extension with a single click

To conserve time while doing repetitive tasks, shortcuts can help. If you often use Chrome Extensions, you can place a specific Extension in the Windows Taskbar for easy access.

Select the desired Chrome App / Extension from the list of installed Apps by clicking on the Apps button which is the first button in the Bookmarks bar of Chrome browser or type chrome://apps in the address bar
In the page that opens up, right click on the Chrome App / Extension in the list and select "" from the context menu.
In the dialog box that opens, choose where you wish to have the application shortcuts.

I like invoking the Postman Chrome Extension (for testing REST calls) from the Taskbar with a single click.

Friday, 13 November 2015

HOW TO filter products in Flipkart sold by WS Retail

Before you read further, note that this is not a perfect way to find all products in Flipkart sold by WS Retail but it is possibly the simplest and may help you find something you are looking for.

Like many other annoyed users, I was stuck with money in my Flipkart wallet that can be used only to purchase products from the seller "WS Retail" till I found this way. Just in case you didn't know, if you are dealing with Flipkart gift vouchers, you can only purchase from the seller "WS Retail" on the Flipkart shopping site.

Try this set of keywords with the site operator on Google or Bing or DuckDuckGo - "SOLD BY" "WS Retail" site:flipkart.com

To exclude "Out of Stock" products stick a minus sign before the quote-enclosed keywords and add a plus sign before product names that you want to restrict your search by.

The below keywords will fetch results for products that have Lumia in them which are sold by WS Retail and NOT out of stock  -
+"Lumia" -"Out of Stock!" "SOLD BY" "WS Retail" site:flipkart.com 

Note that WS Retail may also appear anywhere in the page - in the comments section or in the list of other sellers and there may be some "false positive" results.

Monday, 21 September 2015

HOW TO remove unwanted sections of a web page while printing

With Chrome & Internet Explorer, it is possible to print only selected text within a web page. Today, I had need to print a web page without some sections like video and unwanted subtitles.

It turns out, with Chrome Developer Tools (keyboard shortcut F12) you can delete the tags representing that section and then print the page.
After the web page loads, hit F12 to open the Developer Tools pane and use the Magnifier icon to select the element in the page to delete

Within the Developer Tools pane, select the tag containing the content that needs to be deleted and hit the Delete key to remove it from the web page before printing it.

Also see: HOW TO extract sets of pages from a PDF document or web page to a new PDF

Sunday, 23 August 2015

HOW TO copy a doc / spreadsheet from Google Docs to OneDrive without saving to local computer

1. Open the document or spreadsheet to be copied to OneDrive, within Google Docs / Drive
2. From the menu, choose File > Email as Attachment...

3. In the dialog box that opens, choose to attach the file as .docx or .xlsx as appropriate and email it to your Microsoft account

4. When the email is opened within Outlook.com, click on the button View in OneDrive to view & save that file in OneDrive to view it in Word Online or Excel Online

Monday, 13 July 2015

HOW TO extract sets of pages from a PDF document or web page to a new PDF

There are free tools like PDFRider that let you manipulate PDF files and do things like extracting only some pages from a PDF document & packaging them into a new PDF. But why bother installing tools when Google Chrome browser can do that for you.

Chrome can open not just web pages but also local PDFs. You don't need a PDF reader anymore if all you generally do is scroll through them.

With the Print option of Chrome, you can save any web page as a PDF. What's more, you can extract sets of pages from a PDF document or specific pages of a web page to a new PDF by specifying page ranges separated by a comma.
This is not a common use case but remember when you face such a scenario, you don't need any other utilities.