hulse | Ruby wrapper for House and Senate roll call votes | Application Framework library
kandi X-RAY | hulse Summary
kandi X-RAY | hulse Summary
Hulse is a Ruby gem for accessing raw data and information published by and about the U.S. Congress. It works using Ruby 1.9.3, 2.0, 2.1 and 2.2. It is not a wrapper for existing non-governmental APIs of congressional information. Instead, it loads, parses and scrapes official sources. Hulse can be used to get House and Senate roll call votes from the official sources on house.gov and senate.gov. Hulse has two vote classes, HouseVote and SenateVote, which create Ruby objects using the XML attributes available from roll call vote data (voice votes are not covered by Hulse or available as data from official sources). Hulse makes a few changes, renaming some attributes for clarity and consistency, and collapsing each House vote's date and time into a single datetime attribute. Otherwise it does not alter the original data. HouseVote and SenateVote have different attributes due to parliamentary conventions and the presence or absence of data in one chamber or the other. Senators are uniquely identified by a lis_member_id; House members are uniquely identified by a bioguide_id beginning in 2003. Prior to 2003, there is no unique ID for House members, but using a combination of name, state and political party one can be manufactured. House member attributes also include an unaccented_name and a name attribute that may contain accent characters. Both HouseVote and SenateVote have class methods that will return the number of the latest vote in each chamber. Hulse also has two member classes, HouseMember and SenateMember, which create Ruby objects using the XML made available by the Clerk of the House and the Secretary of the Senate. House members have some basic information, including the unique bioguide_id, along with office details and committee and subcommittee assignment data. For vacant seats, information on the seat's previous occupant is available. Senate members have less information, but their data includes the Senate class and the URLs of their websites and email forms. Hulse has three other classes, HouseFloor, Record and Communication. The first provides a wrapper to XML data on floor activity published by the Clerk of the House, including timestamps and descriptions. The Record class provides a basic wrapper to the Congressional Record, the daily listing of activities by the House and Senate, as well as some methods for accessing specific portions of it, particularly the titles and permalinks of articles. The Communication class provides a wrapper to presidential and executive branch communications sent to the Senate. Lastly, if you ever need to convert a year to its corresponding congress and session numbers, Hulse has a utility method for doing so. Hulse is named for Carl Hulse, a longtime congressional correspondent for The New York Times.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get the actions of the actions
- Returns the credit to the user s base url
- Get the text of the text .
- Get all subjects
- Scans the list of amendments
- Locate the ranking ranking for the list
hulse Key Features
hulse Examples and Code Snippets
Community Discussions
Trending Discussions on hulse
QUESTION
I am creating an API output by manipulating an already existent API into a format that is more useful to myself. The data that I am returning is the vehicles and their estimated time of arrivals the stops within the next 30 minutes, all on one route. However, I want to only return the latest/closest to the current time for each distinct vehicle. Ultimately, this will output their location.
The output at the moment will display multiple ETAs for each vehicle. I only want to return the closest ETA for each unique vehicle.
Data Array:
The "when" key is a UNIX timestamp that I've already converted so the closest time to the present can be calculated with that in mind. I just need the distinct vehicles with their closest to present time to be in the array.
Data Source:
...ANSWER
Answered 2019-Jan-02 at 02:34this would sort them into one sub-array per vehicle and check for the lowest timestamp:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hulse
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page