![]() |
2012-11-04
, 22:28
|
Posts: 2,292 |
Thanked: 4,135 times |
Joined on Apr 2010
@ UK
|
#2
|
![]() |
2012-11-04
, 23:19
|
Posts: 638 |
Thanked: 1,692 times |
Joined on Aug 2009
|
#3
|
Use an API to get your data as it should be easier to work with.
Here's a website that seems to be able to provide JSON
www.geonames.org/export/JSON-webservices.html
There are other maemo apps that have used JSON before. Look at the sources for bfbc2stats for example.
The Following User Says Thank You to xes For This Useful Post: | ||
![]() |
2012-11-05
, 07:46
|
Posts: 2,292 |
Thanked: 4,135 times |
Joined on Apr 2010
@ UK
|
#4
|
The Following User Says Thank You to sixwheeledbeast For This Useful Post: | ||
![]() |
2012-11-05
, 08:24
|
Posts: 638 |
Thanked: 1,692 times |
Joined on Aug 2009
|
#5
|
![]() |
2012-12-04
, 17:08
|
Posts: 638 |
Thanked: 1,692 times |
Joined on Aug 2009
|
#6
|
![]() |
2013-09-01
, 21:36
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#7
|
The Following User Says Thank You to Estel For This Useful Post: | ||
![]() |
2013-09-01
, 22:43
|
Posts: 638 |
Thanked: 1,692 times |
Joined on Aug 2009
|
#8
|
![]() |
2013-09-04
, 12:56
|
|
Posts: 2,222 |
Thanked: 12,651 times |
Joined on Mar 2010
@ SOL 3
|
#9
|
The Following User Says Thank You to joerg_rw For This Useful Post: | ||
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?
Last edited by xes; 2012-12-04 at 17:53.