Spent the long weekend fiddling with R and Python mainly to pull the data - and then cleaning and reorganising.

Among others, I wrote a python script to reorganise the table containing seismological record from seismonepal.gov.np website.

I have used =ImportHTML() to fetch the data from above table. I could have written scrapper but whenever data is in tabular form I rely on Google Spreadsheet to convert table into CSV.

=ImportHTML("http://seismonepal.gov.np/index.php", "table", 1)

Next, a python script converts data in English into Nepal

#List of character/word to be replaced
replaceDict = {
    '1':'१' ,
    '2':'२' ,
    '3':'३' ,
    'Local Time' : 'LocalTime',
    'Magnitude(ML)' : 'Magnitude',
    'Achham' : 'अछाम'   ,
    'Arghakhanchi' : 'अर्घाखाँची'   ,
    'Baglung' : 'बाग्लुङ'   
    }

 #Function to replace word 
 def replace_all(text, dic):
    for i, j in dic.iteritems():
        text = text.replace(i, j)
    return text

 #Iteration
 with open('earthquake.csv', 'rb') as csvfile:
    earthquake = csv.reader(csvfile, delimiter=',')

    for row in range(record2read):

        row = [word.replace('*','') for word in earthquake.next()]
        row = ' '.join(row).encode('utf-8')
        row = replace_all(row, replaceDict)

And writing the result into JSON format with Nepali data.

{
    "earthquake": [
        {
            "MM": "५",
            "DD": "१७",
            "Longitude": "८५.८७",
            "Epicentre": "रामेछाप",
            "Magnitude": "४.६",
            "YYYY": "२०१५",
            "Remarks": "NSC",
            "Date": "१७/०५/२०१५",
            "Latitude": "२७.४८",
            "LocalTime": "११:३०"
        },
        {
            "MM": "५",
            "DD": "१७",
            "Longitude": "८६.०६",
            "Epicentre": "दोलखा",
            "Magnitude": "४.४",
            "YYYY": "२०१५",
            "Remarks": "NSC",
            "Date": "१७/०५/२०१५",
            "Latitude": "२७.७३",
            "LocalTime": "०५:००"
        },
        {
            "MM": "५",
            "DD": "१६",
            "Longitude": "८६.१४",
            "Epicentre": "दोलखा",
            "Magnitude": "४.३",
            "YYYY": "२०१५",
            "Remarks": "NSC",
            "Date": "१६/०५/२०१५",
            "Latitude": "२७.६४",
            "LocalTime": "२०:४४"
        }]}

Finally - widget based on above JSON file. HimalKhabar has embedded it in its website.