View Single Post
Posts: 638 | Thanked: 1,692 times | Joined on Aug 2009
#1
While walking on the road to prepare a widget to notify the latest seismic events....

Here attached you can find the script
earthquakes.sh

It is a parser that can retrieve data from USGS, EMSC, INGV(italy) and CRS(north italy), format all information, convert time to GMT and calculate distance from your position.

At the beginning of the file you have to define your position (default is Rome)
At the end of file you can choose the output format.

Pay attention! To run correctly, the command "date" must be the gnu version... So it should be linked to /usr/bin/gnu/date

The syntax is:
earthquakes.sh all|crs|ingv|emsc|usgs MaxNumEvents

(if not specified, MaxNumEvents = 20. Maximum is 50)

So, running:
earthquakes.sh all 30

Will produce:
2375.2 km;2012-12-04;16:29:48;ML 2.0;39.34;40.55;EASTERN TURKEY;EMSC;
1063.4 km;2012-12-04;16:24:35;ML 2.8;36.92;23.06;SOUTHERN GREECE;EMSC;
909.9 km;2012-12-04;16:22:07;MB 3.3;36.59;4.44;STRAIT OF GIBRALTAR;EMSC;
909.2 km;2012-12-04;16:21:48;ML 2.2;38.35;22.12;GREECE;EMSC;
2608.9 km;2012-12-04;15:55:00;ML 2.4;37.43;42.57;TURKEY-SYRIA-IRAQ BORDER REGION;EMSC;
5231.2 km;2012-12-04;15:46:28;ML 2.6;32.45;71.53;OFFSHORE VALPARAISO, CHILE;EMSC;
1465.6 km;2012-12-04;15:45:05;ML 2.4;40.32;29.88;WESTERN TURKEY;EMSC;
12642.3 km;2012-12-04;15:41:33;M 4.5;7.32;143.77;NEAR S COAST OF NEW GUINEA, PNG.;EMSC;
8446.9 km;2012-12-04;15:35:33;ML 3.3;61.2312;-150.8077;48km W of Anchorage Alaska;USGS;
1504.7 km;2012-12-04;15:27:58;ML 2.4;39.69;30.15;WESTERN TURKEY;EMSC;
850.1 km;2012-12-04;15:23:31;ML 3.1;36.78;5.14;NORTHERN ALGERIA;EMSC;
5219.7 km;2012-12-04;15:17:56;ML 2.4;33.93;72.36;OFFSHORE O'HIGGINS, CHILE;EMSC;
5225.1 km;2012-12-04;15:15:54;ML 2.7;33.92;72.42;OFFSHORE O'HIGGINS, CHILE;EMSC;
5817.1 km;2012-12-04;15:10:02;ML 2.9;19.88;69.19;TARAPACA, CHILE;EMSC;
8441.1 km;2012-12-04;15:08:16;ML 2.9;60.8733;-147.4063;64km WSW of Valdez Alaska;USGS;
2423.9 km;2012-12-04;15:02:39;ML 1.9;39.13;41.06;EASTERN TURKEY;EMSC;
9895.9 km;2012-12-04;14:44:00;ML 2.6;40.3132;-124.4685;33km SSW of Ferndale California;USGS;
9897.3 km;2012-12-04;14:32:01;ML 3.3;40.2953;-124.4628;35km SSW of Ferndale California;USGS;
1724.2 km;2012-12-04;13:50:31;ML 3.0;40.51;33.06;CENTRAL TURKEY;EMSC;
5213.2 km;2012-12-04;13:24:33;ML 3.3;32.54;71.37;VALPARAISO, CHILE;EMSC;
5216.3 km;2012-12-04;13:05:02;ML 3.3;32.68;71.50;OFFSHORE VALPARAISO, CHILE;EMSC;
8449.1 km;2012-12-04;13:01:04;ML 2.6;61.2118;-150.8212;49km W of Anchorage Alaska;USGS;
.....

So, while waiting some developer to help me preparing a real widget...
I'm using this with "Desktop Command Execution Widget"
(http://maemo.org/packages/view/desktop-cmd-exec/)

Attached, the screenshot obtained with this applet...



....
Now i would prepare something to obtain a widget for maemo.
Anyone knows if there is something already developed usable to obtain this kind of widget?

Anyone could give me some help or idea?
Attached Images
 
Attached Files
File Type: zip earthquakes.zip (2.1 KB, 102 views)

Last edited by xes; 2012-12-04 at 17:53.
 

The Following 6 Users Say Thank You to xes For This Useful Post: