CityOfNewYork / DOT-Data-Feeds

11 stars 5 forks source link

Where is the 311 Today data (Street cleaning suspension a.k.a. alternate side, etc.)? #1

Open fedex1 opened 10 years ago

fedex1 commented 10 years ago

Please let us know where in the online API the basic 311 Today information is?

We try the following:

#!/usr/bin/env python
import DOT

obj = DOT.DOT('CLIENT-CODE','CLIENT-SECRET')
# print vars(obj.getParkingInfo(obj.p_ParkReminder))
print obj.getParkingInfo(obj.p_ParkReminder)

WHERE IS THE 311 Today data?

It returns:

<rss version="2.0">
<channel>
<generator>Feed Editor</generator>
<pubDate>5 Jan 2012 10:08:32 GMT</pubDate>
<title>Parking Regulations Raw Data Has been Updated!</title>
<description/>
<link>
http://a841-dotweb01.nyc.gov/datafeeds/ParkingReg/ParkingRegReminder.xml
</link>
<language>en</language>
<item>
<title>Data Updated</title>
<pubDate>6 Dec 2013 14:12:00 GMT</pubDate>
<link>
http://a841-dotweb01.nyc.gov/datafeeds/ParkingReg/ParkingRegReminder.xml
</link>
<guid isPermaLink="false">ACDACE4C-231C-410C-92C9-DA4C9EF129CC</guid>
</item>
</channel>
</rss>

It seems to only say "data updated"

technickle commented 10 years ago

If you are referring to NYC's Open311 Inquiry API, then this is not the correct client library to use. Instead, see the Open311-Inquiry client. I'm not 100% sure that client library is up-to-date, but it's certainly the one which should supply the 311 today feed.

fedex1 commented 10 years ago

@technickle thank you for your comment.

I'm looking at the "Open311 Inquiry API" https://developer.cityofnewyork.us/api/open311-inquiry

But I don't see any 311 Today support.

Is there a proper API Playground where you can see working samples and modify them and run them? Can you send or post a link to the API Playground. Thanks.

I see this when dumping out the variables associated with the library object:

In open311
<open311SNSL.serviceList instance at 0xb724bfcc>
{'xml': 'xml', 's_Environment_Sanitation': 'Environment and Sanitation', 'key': 'cbb57daa7dbe94ae61ba0fec13d871e1', 's_PubSafe_Law': 'Public Safety and Law', 's_Social_Services': 'Social Services', 's_Finder': 'finder', 's_Health_Medicine': 'Health and Medicine', 's_Business_Finance': 'Business and Finance', 'json': 'json', 's_Mobile': 'mobile', 's_all': 'all', 's_Education_Employment': 'Education and Employment', 's_Web': 'web', 's_Property_Building_Home': 'Property, Buildings and Homes', 'id': 'ceb8a41f', 's_Gov_Civ_Services': 'Government and Civil Services'}
GregorySoto commented 10 years ago

You're correct, the 311 Today support is not currently available in the client. We're currently updating the Open 311 Inquiry client to add additional methods and these should be available sometime next month.

In the meantime, you can access the Open 311 Today Feed by leveraging the API directly. The 311 Today Feed provides daily status messages regarding Public Schools, Alternate Side Parking, and Garbage/Recycling pick up.

Edit: If you're a registered developer with the NYC Developer Portal, you can access the Open 311 API sandbox to test the 311 Today support.

fedex1 commented 10 years ago

@GregorySoto thank you very much.

Can you post a link to the page you are referring to when you say: "you can access the Open 311 Today Feed by leveraging the API directly"

We use

http://www1.nyc.gov/apps/311/311Today.rss

and we find that the data is incorrect. For example, on this past Tuesday street cleaning was suspended but the feed incorrectly stated that street cleaning rules are in effect.

This is from the 311 website http://www1.nyc.gov/311/: (but http://www1.nyc.gov/apps/311/311Today.rss did NOT contain this information)

12/16/2013 6:08:00 PMTravel Advisory / Alt Side Parking Suspension for 12/17 (CW)Notification issued 
GregorySoto commented 10 years ago

You can access the API by navigating to the following page and clicking on the "Active Documentation" link. Bear in mind, you must be logged in to access the Active Docs page, and must have created a Project that uses the Open 311 API.

https://developer.cityofnewyork.us/api/open311-inquiry

fedex1 commented 10 years ago

@GregorySoto Wow thank you very much! It works!

Please if you could suggest to the page creator to maybe add "Test the real live API" or "Go to the API Playground", "Active Documentation" might be missed by a lot of developers.

Here's working output. Thanks again!

{
 "items": [
  {
   "date": "Thursday, December 19, 2013",
   "today_id": "20131219",
   "items": [
    {
     "icon": "/portal/apps/311_images/ico-parking.png",
     "details": "Alternate side parking and meters in effect",
     "status": "IN EFFECT",
     "type": "Parking"
    },
    {
     "icon": "/portal/apps/311_images/ico-trash.png",
     "details": "Garbage and recycling collections on schedule",
     "status": "ON SCHEDULE",
     "type": "Garbage and Recycling"
    },
    {
     "icon": "/portal/apps/311_images/ico-school.png",
     "details": "Public schools in session",
     "status": "OPEN",
     "type": "Schools"
    }
   ]
  }
 ]
}            
GregorySoto commented 10 years ago

That's good to hear. We appreciate the feedback and will look into making that change.

fedex1 commented 10 years ago

Hi Gregory,

Thanks again.

And a related question: The Android NYC 311 application gets information for future days. Is this done via the API and if so, where is that API?

If not, does it do it via the published calendar and then update it when new information comes via the API.

Ralph

On Thu, Dec 19, 2013 at 2:09 PM, Gregory Soto notifications@github.comwrote:

That's good to hear. We appreciate the feedback and will look into making that change.

— Reply to this email directly or view it on GitHubhttps://github.com/CityOfNewYork/DOT-Data-Feeds/issues/1#issuecomment-30956476 .

GregorySoto commented 10 years ago

Ralph,

Take a look again at the Open 311 API's 311 Today Feed method. It has been extended to accept start and end date parameters for a date range. Either of these are optional and provides info for past and future dates.

-Greg

fedex1 commented 10 years ago

Thank you.

I must have missed that. I apologize.

Where is the date format documented?

I try

https://api.cityofnewyork.us/311/v1/municipalservices?startDate=20130101&endDate=20140101. ..

and it returns:

{

}

On Fri, Dec 20, 2013 at 12:19 PM, Gregory Soto notifications@github.comwrote:

Ralph,

Take a look again at the Open 311 API's 311 Today Feed method. It has been extended to accept start and end date parameters for a date range. Either of these are optional and provides info for past and future dates.

-Greg

— Reply to this email directly or view it on GitHubhttps://github.com/CityOfNewYork/DOT-Data-Feeds/issues/1#issuecomment-31025729 .

GregorySoto commented 10 years ago

Thanks for pointing that out. Please check the sandbox for the expected date format.

fedex1 commented 10 years ago

Thank you.

I think there may be typographical error.

It currently reads: The start date for a date range. If blank, today's date will be used. Valid format is MMddYYY

I think you mean MMDDYYYY

At least that seems to work.

Working examples always are helpful.

For example, https://api.cityofnewyork.us/311/v1/municipalservices?startDate=01012013&endDate=12312015

gets most of the known data at the moment.

Thanks, Ralph

On Fri, Dec 20, 2013 at 3:01 PM, Gregory Soto notifications@github.comwrote:

Thanks for pointing that out. Please check the sandbox for the expected date format.

— Reply to this email directly or view it on GitHubhttps://github.com/CityOfNewYork/DOT-Data-Feeds/issues/1#issuecomment-31037410 .

fedex1 commented 10 years ago

Also, here's an example of the open 311 API used from the Google Glass Development Kit. See http://timingblog.brooklynmarathon.com/2013/12/nyc-311-on-google-glass.html

A small sample:

[image: Inline image 1] [image: Inline image 2]

On Fri, Dec 20, 2013 at 3:39 PM, Ralph Yozzo ralph@brooklynmarathon.comwrote:

Thank you.

I think there may be typographical error.

It currently reads: The start date for a date range. If blank, today's date will be used. Valid format is MMddYYY

I think you mean MMDDYYYY

At least that seems to work.

Working examples always are helpful.

For example,

https://api.cityofnewyork.us/311/v1/municipalservices?startDate=01012013&endDate=12312015

gets most of the known data at the moment.

Thanks, Ralph

On Fri, Dec 20, 2013 at 3:01 PM, Gregory Soto notifications@github.comwrote:

Thanks for pointing that out. Please check the sandbox for the expected date format.

— Reply to this email directly or view it on GitHubhttps://github.com/CityOfNewYork/DOT-Data-Feeds/issues/1#issuecomment-31037410 .

lantwi commented 8 years ago

Hello, do you know where I can find the parking regulations API?