Categories
Google

Import Web Data into Google Docs

I’ve been using Google Docs since long to create documents and spreadsheets but recently discovered that Google’s cloud-based Office suite provide us lot of other flexibilities.

A useful Google formula “ImportHTML” helps us to fetch tables and lists from an external web page into a Google Drive’s spreadsheet.

Create a spreadsheet inside Google Drive/Docs. Edit any of its cell to enter the formula/function as below.

=ImportHTML("http://en.wikipedia.org/wiki/List_of_Bollywood_films_of_2012", "table", 2)

Now come out of the cell and Google Docs will import the second table from the mentioned Wiki page into your sheet.

The 1st parameter of the function ImportHTML is nothing but the Target URL, 2nd parameter allows us to select which format of data we wish to import. This can be table (for tabular format), list (for ordered list) etc. The 3rd parameter says which index/number/position of the desired format data on the page that needs to be imported. If we put 4 instead of 2 in the third parameter of the above formula, then Docs API will import the forth table from the web page.

importHTMLThe beauty of these magical functions may help us in tracking web page changes. This may be utilized for tracking price fluctuations for a product on any eCommerce portal.

Google Docs is inbuilt with such amazing wonderful functions e.g.  ImportFeed, ImportHTML and ImportXML.

'Coz sharing is caring
Categories
PHP Technology

Credit Card Numbers for Payment Gateway Testing

I recently developed a site that utilized a merchant gateway. I had the gateway in “Test” mode so i could process fake transactions to ensure the system was working properly.

The only fake credit card number I could use was 4111111111111111 which is denoted as a VISA card.

Anyhow, I wanted to make sure I could test with other numbers so I tried putting in random 16 digit numbers. Doing so caused the gateway to return an error, “Invalid Credit Card #”

The reason for this is because the credit card number was not a Mod-10 Credit card number. Mod-10 is used to validate credit card numbers.

Anyhow, here are 2 credit card numbers that you can use for credit card testing when interacting with a payment gateway in test mode:

1. 4111111111111111
2. 4111111111111103

How it verify Mod-10:

1. Take a credit card number and reverse it: 1111111111111114

2. Now multiple each even digit by 2.

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4
_ 2 _ 2 _ 2 _ 2 _ 2 _ 2 _ 2 _ 2

Which is: 2+2+2+2+2+2+2+8 = 22

Note:If any results from your multiples of 2 are 2 digits or greater, then split the digits and add them together
So if 2×6=12 you would add (1+2) not 12
2+2+2+2+ (1 + 2)…

3. Now add the odd digits to 22, 22 + 1 + 1 + 1 +1 +1 +1 + 1 + 1 = 30

4. Now divide by 10

30/10 = 3

Since there is no remainder the card number is Mod-10. If there is a remainder, then the card # is NOT Mod-10

Now with this method you can come up with your own Mod-10 Numbers for testing.

The CVV can be used as 123

'Coz sharing is caring