Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SkyTruth API links for newly relaunched SkyTruth Alerts #118

Closed
jywarren opened this issue Feb 13, 2019 · 8 comments · Fixed by #507
Closed

Update SkyTruth API links for newly relaunched SkyTruth Alerts #118

jywarren opened this issue Feb 13, 2019 · 8 comments · Fixed by #507
Labels
help wanted Extra attention is needed

Comments

@jywarren
Copy link
Member

jywarren commented Feb 13, 2019

https://alerts.skytruth.org was relaunched this year! Notes on this here: https://skytruth.org/2019/01/new-year-new-alerts/

Our layer for @SkyTruth is not working now due to the updates. We'll probably have to adjust this line and more:

var SkyTruth_url = "https://alerts.skytruth.org/json?n=100&l="+(southwest.lat)+","+(southwest.lng)+","+(northeast.lat)+","+(northeast.lng) ;

Note: CORS is not enabled in the new system but we've emailed. (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)

Follow-up - there are lots of great layers available here: https://skytruth.org/tech/interactive-maps-data-sets/

@jywarren jywarren added the help wanted Extra attention is needed label Feb 13, 2019
@jywarren
Copy link
Member Author

@jywarren
Copy link
Member Author

Yep!

@jywarren
Copy link
Member Author

So we're looking to parse data like this:

{ "feed":[
{
    "id": "6aa254c3-f512-3018-964d-fd8fb176d234",
    "source": "1",
    "title": "NRC Report: Oily Water",
    "link": "https://alerts1.skytruth.org/report/6aa254c3-f512-3018-964d-fd8fb176d234#c=json",
    "description": "<b>Report Details<\/b><br\/>NRC Report ID: <a href=\"http:\/\/nrc.uscg.mil\/\">1237321<\/a><br\/>Incident Time: 2019-02-10 11:25:00<br\/>Nearest City: LA<br\/>Location: <br\/>Incident Type: PLATFORM<br\/>Material: OILY WATER<br\/>Medium Affected: WATER<br\/>Suspected Responsible Party: CANTIUM<br\/><b>SkyTruth Analysis<\/b><br\/>Lat\/Long: 29.409444, -88.982222 (Explicit)<br\/>Reported Sheen Size: 30 feet by 1.33 miles (area 4.82 acres)<br\/>Reported Spill Volume: 0.38 gallon<br\/>SkyTruth Minimum Estimate: 5.15 gallons<br\/><b>Report Description<\/b><br\/>CALLER REPORTED THEY HAD A PIN HOLE LEAK ON A FLOW LINE.<p><a href=\"https:\/\/alerts1.skytruth.org\/report\/6aa254c3-f512-3018-964d-fd8fb176d234#c=json\" target=\"_top\">View Full Report<\/a><\/p><img src=\"https:\/\/alerts1.skytruth.org\/ga.php?utmac=UA-25593503-1&utmn=1561664721&utmr=-&utmp=%2Fsyndication%2Fjson%2F6aa254c3-f512-3018-964d-fd8fb176d234&guid=ON\"\/>",
    "lat": "29.4094444444",
    "lng": "-88.9822222222",
    "published": "2019-02-13 04:51:41.008",
    "updated": "2019-02-13 04:51:41.008",
    "incident_datetime": "2019-02-10 11:25:00"    
}
,{
    "id": "8dd7b709-e263-359b-b68d-bdccfd7917ab",
    "source": "1",
    "title": "NRC Report: Hydraulic Oil near Golden Meadow, LA",
    "link": "https://alerts1.skytruth.org/report/8dd7b709-e263-359b-b68d-bdccfd7917ab#c=json",
    "description": "<b>Report Details<\/b><br\/>NRC Report ID: <a href=\"http:\/\/nrc.uscg.mil\/\">1237335<\/a><br\/>Incident Time: 2019-02-10 02:00:00<br\/>Nearest City: Golden Meadow, LA<br\/>Location: 106 9TH ST<br\/>Incident Type: FIXED<br\/>Material: HYDRAULIC OIL<br\/>Medium Affected: WATER<br\/>Suspected Responsible Party: EDISON CHOUEST<br\/><b>SkyTruth Analysis<\/b><br\/>Lat\/Long: 29.382161, -90.265514 (Approximated from CITY_STATE)<br\/>Reported Spill Volume: 0.25 gallon<br\/><b>Report Description<\/b><br\/>HYDRAULIC OIL DISCHARGED FROM A HYDRAULIC HOSE ON A CRANE DUE TO AN EQUIPMENT FAILURE (HOSE RUPTURED).<p><a href=\"https:\/\/alerts1.skytruth.org\/report\/8dd7b709-e263-359b-b68d-bdccfd7917ab#c=json\" target=\"_top\">View Full Report<\/a><\/p><img src=\"https:\/\/alerts1.skytruth.org\/ga.php?utmac=UA-25593503-1&utmn=125249448&utmr=-&utmp=%2Fsyndication%2Fjson%2F8dd7b709-e263-359b-b68d-bdccfd7917ab&guid=ON\"\/>",
    "lat": "29.382161396308",
    "lng": "-90.2655137400044",
    "published": "2019-02-13 04:51:34.003",
    "updated": "2019-02-13 04:51:34.003",
    "incident_datetime": "2019-02-10 02:00:00"    
}
]}

We can update to the new format once we determine it.

jywarren added a commit that referenced this issue Feb 13, 2019
@jywarren
Copy link
Member Author

Submitted a short term fix to switch to alerts1 layer here: e36f294

But looking to update for the new API as we learn more.

@jywarren
Copy link
Member Author

jywarren commented Feb 13, 2019

New format looks to be:

https://skytruth-alerts2.appspot.com/api/getalerts/?l=33.9775,-101.2861,41.0598,-90.2449&dates=undefined,undefined&selected=1,4,5,9&n=100&keyword=

Format:

[{"model": "img.feedentry",
 "pk": "ab970622-3b85-97c6-2673-8f61f0a9fc69",
 "fields": {"title": "NRC Report: Freon near Sherwoord,
 AR",
 "link": "http://nrc.uscg.mil/",
 "summary": "Incident Type: FIXED - NRC Report ID: 1236621 - Medium Affected: AIR - Suspected Responsible Party: BRICE TRAILER PARK",
 "content": "<b>Report Details</b><br/>NRC Report ID: <a href=\"http://nrc.uscg.mil/\" target=\"_blank\">1236621</a><br/>Incident Time: 2019-02-02 12:00:00<br/>Nearest City: Sherwoord,
 AR<br/>Location: 3513 HOLLAMOR<br/>Incident Type: FIXED<br/>Material: FREON<br/>Medium Affected: AIR<br/>Suspected Responsible Party: BRICE TRAILER PARK<br/><b>SkyTruth Analysis</b><br/>Lat/Long: 34.815091,
 -92.224315 (Approximated from locality) <a href=\"https://www.skytruth.org/alerts2/geocoding/\" target=\"_blank\"><img src=\"/images/icons8-info-20.png\" align=\"center\" /></a><br/><b>Report Description</b>CALLER IS REPORTING THAT THE SRP IS RELEASING FREON TO THE ATMOSPHERE FROM AIR CONDITIONING UNITS.",
 "lat": 34.8150907,
 "lng": -92.2243153,
 "source_id": 1,
 "kml_url": "",
 "incident_datetime": "2019-02-02T12:00:00",
 "published": "2019-02-05T10:03:11.008",
 "regions": "[129,
 1221,
 1505,
 4669,
 991,
 807]",
 "tags": "['NRC',
 'other',
 'release']",
 "the_geom": "SRID=4326;POINT (-92.2243153 34.8150907)",
 "source_item_id": 1236621,
 "status": "published",
 "legacy_published": null}},

{"model": "img.feedentry",
 "pk": "1cf6efa0-82b5-96f5-c27e-bcab53ede1f0",
 "fields": {"title": "NRC Report: Condensate",
 "link": "http://nrc.uscg.mil/",
 "summary": "Incident Type: PIPELINE - NRC Report ID: 1236593 - Medium Affected: WATER - Suspected Responsible Party: ONEOK FIELD SERVICES",
 "content": "<b>Report Details</b><br/>NRC Report ID: <a href=\"http://nrc.uscg.mil/\" target=\"_blank\">1236593</a><br/>Incident Time: 2019-02-02 10:40:00<br/>Nearest City: OK<br/>Location: SEE LAT/LONG<br/>Incident Type: PIPELINE<br/>Material: CONDENSATE<br/>Medium Affected: WATER<br/>Suspected Responsible Party: ONEOK FIELD SERVICES<br/><b>SkyTruth Analysis</b><br/>Lat/Long: 35.640556,
 -99.934444 (Explicit) <a href=\"https://www.skytruth.org/alerts2/geocoding/\" target=\"_blank\"><img src=\"/images/icons8-info-20.png\" align=\"center\" /></a><br/><b>Report Description</b>CALLER REPORTED THAT A PIPELINE LEAKED CONDENSATE AND CREATED A SHEEN ON THE WATER.",
 "lat": 35.6405555556,
 "lng": -99.9344444444,
 "source_id": 1,
 "kml_url": "",
 "incident_datetime": "2019-02-02T10:40:00",
 "published": "2019-02-05T10:03:10.006",
 "regions": "[163,
 820,
 1236,
 3739,
 991,
 6715,
 944,
 919,
 807]",
 "tags": "['NRC',
 'oil',
 'release']",
 "the_geom": "SRID=4326;POINT (-99.9344444444 35.6405555556)",
 "source_item_id": 1236593,
 "status": "published",
 "legacy_published": null}}
]

@jywarren
Copy link
Member Author

Looks like it's not a CORS issue after all!

@jywarren
Copy link
Member Author

It's currently an issue with HTTP vs. HTTPS -- the old API doesn't allow HTTPS and so we can't use it any more 😭

time to upgrade to the new one!!!

jywarren added a commit that referenced this issue Feb 16, 2021
@jywarren
Copy link
Member Author

I think we got this in #507 !!

jywarren added a commit that referenced this issue Feb 17, 2021
* Update skytruth api params

fixes #118

* refactor skytruth api

* improved displayed content

* fixed lots of skytruth

* bump to 2.4.2

* skytruth fixes

* fixed cy.route for cy.intercept

* fix cypress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant