OpenStates4j : Alpha ???

25 views
Skip to first unread message

Brandon Gresham

unread,
Apr 1, 2012, 3:31:01 PM4/1/12
to fifty-sta...@googlegroups.com
OK, done with the bulk of the work on the Java wrapper.

The read me on Github shows basic requirements, known limitations, where to go for help/bugs, and some basic example code.
Whether you download it or just look at it on github, I'd appreciate feedback.  :)

Also, is there anything else I should be doing in terms of linking it to the OS project for better visibility for the Java world or anything else along related lines?
Finally, what did I miss or totally fubar???
:)



Brandon Gresham

unread,
Apr 1, 2012, 3:32:13 PM4/1/12
to fifty-sta...@googlegroups.com
One last word... I haven't implemented any actual unit-tests; I plan on it, but want to make sure (based on feedback) that the approach is stable and good.  I plan on going back and putting in a few tests at some point.

Eric Mill

unread,
Apr 1, 2012, 8:30:34 PM4/1/12
to fifty-sta...@googlegroups.com
The syntax for usage looks great to me. I could definitely see integrating this into an Android app or other Java-based program. I'd like to test it out on the command line using the main() function in Bill.java, but for the life of me I can't figure out how to use javac anymore. What's the best way to compile it?

-- Eric




--
You received this message because you are subscribed to the Google Groups "Open State Project" group.
To view this discussion on the web visit https://groups.google.com/d/msg/fifty-state-project/-/5zYehprBuB0J.
To post to this group, send email to fifty-sta...@googlegroups.com.
To unsubscribe from this group, send email to fifty-state-pro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fifty-state-project?hl=en.



--

Brandon Gresham

unread,
Apr 1, 2012, 10:22:22 PM4/1/12
to fifty-sta...@googlegroups.com
Eric,

Honestly I always use NetBeans (at work) or Eclipse (on my own time).

I have always found using javac cumbersome and a general PIA.

If you download and install Eclipse, you should be able to: 
  1. File->Import->Git->Git Repo As New Project
  2. Populate the github address, select a destination, wait to download and all that.
  3. Then expand the tree, right-click on 'src', choose 'new class'... for 'name' call it whatever (I often use 'Runner'), select option 'public static void main()' and hit Finish.
  4. Inside the generated main() right your test-code... something like this:
public static void main(String[] args) throws OpenStatesException {
OpenStates.setApiKey( "{YOUR_KEY}" );
List<District> bills = District.find( "ca" );
System.out.println( bills.get(0).name );
}
 
Finally, right-click on your 'Runner' file and chose 'Run As... Java Application'.

With any luck, it'll work!  :)


Eric Mill

unread,
Apr 2, 2012, 2:01:04 PM4/2/12
to fifty-sta...@googlegroups.com
Thanks, I got it working.

It works great, though one small thing is that it's not a guaranteed property that all API keys are 32 characters, so I would recommend ditching that and just checking for not null and not empty string.

-- Eric

--
You received this message because you are subscribed to the Google Groups "Open State Project" group.

To post to this group, send email to fifty-sta...@googlegroups.com.
To unsubscribe from this group, send email to fifty-state-pro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fifty-state-project?hl=en.



--

Brandon Gresham

unread,
Apr 2, 2012, 9:08:07 PM4/2/12
to fifty-sta...@googlegroups.com
Eric, really appreciate looking at it.  I made your suggestion regarding the API-key length; didn't realize they use keys of differing lengths, good catch.

Are you planning on starting an Adroid app anytime soon?  If not, I might start on a GWT one considering they really don't have a decent webapp for it all yet.  People like me don't do the smartphone thing so not having a webapp really sucks.  :)

Eric Mill

unread,
Apr 2, 2012, 10:13:56 PM4/2/12
to fifty-sta...@googlegroups.com
The Open State team could speak about it in more detail, but yeah, a website is being actively developed, and an Android app is in the discussion/planning stages (both as mentioned on the 50! blog post). All I can say is that is if I were doing an Android app on top of Open States, I would definitely give your library a go.

-- Eric

On Mon, Apr 2, 2012 at 9:08 PM, Brandon Gresham <bra...@thegreshams.net> wrote:
Eric, really appreciate looking at it.  I made your suggestion regarding the API-key length; didn't realize they use keys of differing lengths, good catch.

Are you planning on starting an Adroid app anytime soon?  If not, I might start on a GWT one considering they really don't have a decent webapp for it all yet.  People like me don't do the smartphone thing so not having a webapp really sucks.  :)

--
You received this message because you are subscribed to the Google Groups "Open State Project" group.

To post to this group, send email to fifty-sta...@googlegroups.com.
To unsubscribe from this group, send email to fifty-state-pro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fifty-state-project?hl=en.



--

James Turk

unread,
Apr 3, 2012, 11:57:11 AM4/3/12
to fifty-sta...@googlegroups.com
We're in fact working on a public website now, details will be forthcoming soon.  It is being developed as part of the backend that currently powers open states (http://github.com/sunlightlabs/billy)

The Android app will follow though we aren't yet sure when that'll begin. 

I'll look to make some time to play with your Java library in the next few days, need to get Eclipse up and running on this machine, but based on Eric's feedback it sounds great!  Thanks for all of your work so far on this.

Brandon Gresham

unread,
Apr 3, 2012, 10:14:21 PM4/3/12
to fifty-sta...@googlegroups.com
Sure thing.  I'd actually be awfully stoked if this saw some use in the Android app.  
:)

(so, be sure to give me any feedback you think is needed to make it work well enough for you guys!)
Reply all
Reply to author
Forward
0 new messages