Google Groups

RE: [Sunlight Labs API] Re: Getting bills in .Net


Matthew Klahorst Mar 6, 2012 10:40 AM
Posted in group: Sunlight Labs API Discussion

Great question!

 

Since my clients requirements seem ever-changing and in beta mode, I am not sure all that I need at this point.

 

I ran my script once and DB'd all the data. What I wanted to do is check your "last updated" internal change do I could just update when you updated.

 

And yes, getting all the bill data in one file without destroying your server (and mine)  with a massive script paginating at 50 pages per call would be beneficial.  Better yet, just download from yours and drop to mine (or rsynch).

 

Thanks for your prompt attention.

 

Sincerely,

Matthew Klahorst
Square M, Inc.
23046 Avenida de la Carlota #270
Laguna Hills, CA 92653
Direct: (714) 458-8697
ma...@squareminc.com
www.squareminc.com

web | design | marketing

 

From: sunlightlabs...@googlegroups.com [mailto:sunlightlabs-api-discuss@googlegroups.com] On Behalf Of Eric Mill
Sent: Tuesday, March 06, 2012 10:33 AM
To: sunlightlabs...@googlegroups.com
Subject: Re: [Sunlight Labs API] Re: Getting bills in .Net

 

Okay - can I ask why you want all the fields for every document? Are you really using every one?

 

If you're using it to archive all the information, that's not what the API is designed for -- but I have been considering exporting the content to flat JSON files and offering it as bulk data. You would be able to download all of our bill information at once. Would this be more useful for your purposes?

 

-- Eric

 

On Tue, Mar 6, 2012 at 12:44 PM, Matthew Klahorst <ma...@squareminc.com> wrote:

Eric,

 

One frustration I had with this is that I wanted to pull all fields + the additional fields you have (mongdo db, date added to db, basically the special fields)

 

But when I used sections, it only pulls from those sections and have no way to say something to the effect of (give me all AND the special fields)

 

So if I wanted to add them PLUS all orginal fields, I would have to string them all out in my query which I didn't end up doing.

 

I wanted your special fields so I could check to see if something was updated.

 

THAT BEING SAID - your product is wonderful!

 

Sincerely,

Matthew Klahorst
Square M, Inc.
23046 Avenida de la Carlota #270
Laguna Hills, CA 92653
Direct: (714) 458-8697
ma...@squareminc.com
www.squareminc.com

web | design | marketing

 

From: sunlightlabs...@googlegroups.com [mailto:sunlightlabs-api-discuss@googlegroups.com] On Behalf Of Eric Mill
Sent: Tuesday, March 06, 2012 8:08 AM
To: sunlightlabs...@googlegroups.com
Subject: Re: [Sunlight Labs API] Re: Getting bills in .Net

 

Yes, the 'sections' parameter has been there since the API was launched, it's a comma-separated list of fields you want returned on each object in the response. There's a magic section called 'basic' that returns a bunch of common fields, and you can combine that with others.

 

For example, this returns common fields about bills, and the full list of actions that have occurred to it (use your api key):

http://api.realtimecongress.org/api/v1/bills.json?apikey=[apikey]&bill_id=s1813-112&sections=basic,actions

 

-- Eric

On Tue, Mar 6, 2012 at 10:25 AM, Andy Xufuris <axuf...@gmail.com> wrote:

Does the sections currently work?  Can you show an example how we will
be passing those variables in?


On Mar 1, 11:31 am, Eric Mill <e...@sunlightfoundation.com> wrote:
> The RTC API isn't meant for archiving data. I actually changed the max
> per_page to 50, and I just updated the docs to reflect that. I'm also about
> to change the API so that the 'sections' field is required.
>
> What I may do is start providing bulk data files of the JSON in the
> database behind the API, to facilitate archival usage.
>
> -- Eric
>
>
>
>
>
>
>
>
>

> On Thu, Mar 1, 2012 at 12:27 PM, Andy Xufuris <axufu...@gmail.com> wrote:
> > I was working on getting a larger number for my initial download of
> > the bills.  But i cant get the number of bills to be more than 20?  I
> > went by the documantation and did this
>

> >http://api.realtimecongress.org/api/v1/bills.xml?page=1per_page=500&a...[apikey]&session=112

> > "
>
> > On Feb 28, 2:54 pm, Eric Mill <e...@sunlightfoundation.com> wrote:
> > > Cool, hope it's helpful. We just have sessions 111 and 112 right now.
>
> > > On Tue, Feb 28, 2012 at 3:50 PM, Andy Xufuris <axufu...@gmail.com>
> > wrote:
> > > > Thank you Eric for the quick reply.  I'm still kind of new to JSON and
> > > > XML so its a struggle for me.  I didn't have a preference on json or
> > > > xml so i will take a look at what you sent, hopefully i can understand
> > > > it enough to use it for bills. Also you wouldn't happen to know if
> > > > there is no data for bills in any of the sessions before 111 would
> > > > you?  I did searches for all kinds of sessions but the only ones
> > > > returning are 110, 111, and 112.
>
> > > > On Feb 28, 2:30 pm, Eric Mill <e...@sunlightfoundation.com> wrote:
> > > > > I haven't written any .NET code against our bill API, or using XML -
> > but
> > > > I
> > > > > have against our legislator API, and in JSON, if that's of any help
> > at
> > > > all.
>
> > > > > This is the object wrapper for legislators in Sunlight's Windows
> > Phone 7
> > > > > app, "Congress":
> > > >https://github.com/sunlightlabs/congress-winphone/blob/master/Congres.
> > ..
>
> > > > > It uses the Newtonsoft JSON parsing library:
> > > >http://james.newtonking.com/pages/json-net.aspx
>
> > > > > Also, as you use the RTC API, I would strongly recommend you add a
> > > > > "sections" parameter to limit the scope of what fields you collect.
> > It
> > > > will
> > > > > slim down your response sizes, and will be forward compatible with
> > the
> > > > > changes I announced earlier on this list, which will make that
> > parameter
> > > > a
> > > > > requirement.
>
> > > > > -- Eric
>
> > > > > On Tue, Feb 28, 2012 at 3:04 PM, Andy Xufuris <axufu...@gmail.com>
> > > > wrote:
> > > > > > I'm working in .Net and i am trying to figure out how to pull these
> > > > > > bills into objects.  I have tried this but it hasn't worked.
>
> > > > > > int i = 111;
> > > > > >                XDocument xmlDoc = XDocument.Load("http://
> > > > > > api.realtimecongress.org/api/v1/bills.xml?
> > > > > > apikey=0582b905d77f4041917800b1119adb4e&session=" + i.ToString());
>
> > > > > >                var tutorials = from tutorial in
> > > > > > xmlDoc.Descendants("bill")
> > > > > >                                select new
> > > > > >                                {
> > > > > >                                    SponsorID =
> > > > > > tutorial.Element("sponsor_id").Value,
> > > > > >                                    SponsorFirstName =
> > > > > > tutorial.Element("sponsor").Element("first_name").Value,
> > > > > >                                    SponsorLastName =
> > > > > > tutorial.Element("sponsor").Element("last_name").Value,
> > > > > >                                    LastActionText =
> > > > > > tutorial.Element("last_action").Element("text").Value,
> > > > > >                                    BillNumber =
> > > > > > tutorial.Element("number").Value,
> > > > > >                                    BillType =
> > > > > > tutorial.Element("bill_type").Value,
> > > > > >                                    Enacted =
> > > > > > tutorial.Element("enacted").Value,
> > > > > >                                    EnactedDateTime =
> > > > > > tutorial.Element("enacted_at").Value,
> > > > > >                                    CongressSession =
> > > > > > tutorial.Element("session").Value,
> > > > > >                                    HousePassageResult =
> > > > > > tutorial.Element("house_passage_result").Value,
> > > > > >                                    HousePassageDateTime =
> > > > > > tutorial.Element("house_passage_result_at").Value,
> > > > > >                                    SenatePassageResult =
> > > > > > tutorial.Element("senate_passage_result").Value,
> > > > > >                                    SenatePassageDateTime =
> > > > > > tutorial.Element("senate_passage_result_at").Value,
> > > > > >                                    ShortTitle =
> > > > > > tutorial.Element("short_title").Value,
> > > > > >                                };
>
> > > > > > Has anyone done this, and can they help me through it?
>
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google
> > > > Groups
> > > > > > "Sunlight Labs API Discussion" group.
> > > > > > To post to this group, send email to
> > > > > > sunlightlabs...@googlegroups.com.
> > > > > > To unsubscribe from this group, send email to
> > > > > > sunlightlabs-api-discuss+unsubscribe@googlegroups.com.
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/sunlightlabs-api-discuss?hl=en.
>
> > > > > --
> > > > > Developer | sunlightfoundation.com
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Sunlight Labs API Discussion" group.
> > > > To post to this group, send email to
> > > > sunlightlabs...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > sunlightlabs-api-discuss+unsubscribe@googlegroups.com.
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/sunlightlabs-api-discuss?hl=en.
>
> > > --
> > > Developer | sunlightfoundation.com
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Sunlight Labs API Discussion" group.
> > To post to this group, send email to
> > sunlightlabs...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > sunlightlabs-api-discuss+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/sunlightlabs-api-discuss?hl=en.
>
> --
> Developer | sunlightfoundation.com

--
You received this message because you are subscribed to the Google Groups "Sunlight Labs API Discussion" group.
To post to this group, send email to sunlightlabs...@googlegroups.com.
To unsubscribe from this group, send email to sunlightlabs-api-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sunlightlabs-api-discuss?hl=en.



 

--

 

--
You received this message because you are subscribed to the Google Groups "Sunlight Labs API Discussion" group.
To post to this group, send email to sunlightlabs...@googlegroups.com.
To unsubscribe from this group, send email to sunlightlabs-api-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sunlightlabs-api-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "Sunlight Labs API Discussion" group.
To post to this group, send email to sunlightlabs...@googlegroups.com.
To unsubscribe from this group, send email to sunlightlabs-api-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sunlightlabs-api-discuss?hl=en.



 

--

 

--
You received this message because you are subscribed to the Google Groups "Sunlight Labs API Discussion" group.
To post to this group, send email to sunlightlabs...@googlegroups.com.
To unsubscribe from this group, send email to sunlightlabs-api-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sunlightlabs-api-discuss?hl=en.