Contact details for Representatives and Senators

1 view
Skip to first unread message

steerpike

unread,
Dec 28, 2009, 7:47:29 PM12/28/09
to OpenAustralia Community
Hello,
First off, thanks for the great resource you guys have created. It
literally took me a few seconds using the YQL API associated with
OpenAustralia to generate rss feeds for searching debates for
information relevant to Conroy's internet filter. So thanks for
generating such a simple and practical API.

I have a question though, does anyone have any ideas as to how I could
automatically get contact details for Senators or Representatives I'm
looking up? Is there any kind of API or automated resource that anyone
knows of that has this information? My intent is to try and create a
jQuery plugin that allows people to input their postcode and get
contact details of their local representative. Any thoughts or help
would be most appreciated.

Yours,
Sam Dwyer

Bryce Roney

unread,
Dec 29, 2009, 12:08:58 AM12/29/09
to openaust...@googlegroups.com
Sam,

Is a jQuery plugin really necessary? OpenAustralia already exposes that functionality through its API[1]. All someone would need to do is simply use a $.getJSON() command to access it.

Bryce Roney


--

You received this message because you are subscribed to the Google Groups "OpenAustralia Community" group.
To post to this group, send email to openaust...@googlegroups.com.
To unsubscribe from this group, send email to openaustralia-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openaustralia-dev?hl=en.



steerpike

unread,
Dec 29, 2009, 5:40:12 AM12/29/09
to OpenAustralia Community
Yes the OA API does the fantastic postcode lookup, but it doesn't
provide contact details for the returned information. I'm looking for
information on if I can get email or contact details for individuals
returned so the jquery plugin could generate an automated email to the
relevant representative prefilled with specific content, etc, etc.

Cheers,
Sam

laze...@lazerzap.com

unread,
Jan 3, 2010, 2:40:59 AM1/3/10
to openaust...@googlegroups.com
At the risk of displaying my lack of understanding about most things..
 
I need some help.
 
I'd really like to use the data that available through the api. But obviously my code skills are letting me down.
Previously when stumped. I've searched the net and always found examples or tutorials and been able to overcome whatever was in my way.
 
However with the open australia api I have had no luck at all.
 
Can someone help me with some examples please?
 
I will show you what I have so far...
 
-------------------------------------
 
Contents of test.php
 
<html>
<head>
<title>Open Australia API test - (Under Construction)</title>
<style type="text/css">
  #box { background-color:#FFFF99; border:thin solid #FF0000; width:70%; height:50px;}
  </style>
  <script type="text/javascript" src="firebug.js"></script>
  <script language="javascript" src="jquery-1.3.2.min.js"></script>
  <script language="javascript">
  $(document).ready(function() { //Finish loading the entire page before processing any javascript
  $("#subBut").click(function(event) {
  var formContent = $("#form1").serialize();
  $("#box").load('myserv.php',formContent);
  });
  });
  </script>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
  <label>Main Function<br><br>
  <input type="radio" name="function" value="getDivisions" />
 Electoral Division<br />
  <input type="radio" name="function" value="getRepresentative" />
 MP Details (Id # Required)<br />
  <input type="radio" name="function" value="getRepresentatives" />
 MPs Details<br />
  <input type="radio" name="function" value="getSenator" />
 Senator Details (Id # Required)<br />
  <input type="radio" name="function" value="getSenators" />
 Senators Details<br />
  <input type="radio" name="function" value="getDebates" />
 Debates<br />
  <input type="radio" name="function" value="getHansard" />
 Hansard<br />
  <input type="radio" name="function" value="getComments" />
 Comments<br /><br>
  </label>
  <label>Output Type<br><br>
  <input type="radio" name="output_type" value="xml" /> XML<br>
  <input type="radio" name="output_type" value="js" /> JavaScript<br>
  <input type="radio" name="output_type" value="php" /> PHP<br>
  <input type="radio" name="output_type" value="rabx" /> RABX<br><br>
  </label>
  <label>Search,Postcode,Party,ID<br><br>
  <input type="radio" name="search" value="search" /> Search<br />
  <input type="radio" name="search" value="postcode" /> Postcode (4 digits)<br>
  <input type="radio" name="search" value="party" /> Political Party (Nat,Dem,Gre,Lib,Lab,Ind)<br>
  <input type="radio" name="search" value="id" /> ID # (digits)<br>
  <input type="radio" name="search" value="person" /> Person # (digits)<br>
  <input type="radio" name="search" value="date" /> Date<br>
  <input type="radio" name="search" value="division" /> Electoral Division<br>
  <input type="radio" name="search" value="always_return" /> Always Return Data<br>
  <input type="radio" name="search" value="state" /> State</label><br><br>
  <label>Search for
  <input type="text" name="textfield" id="textfield">
  </label>
  <input type="button" name="subBut" id="subBut" value="Submit">  <a href="http://lazerzap.com/oa/jquery/test.php"> Refresh Page</a>
  </form>
  <br />
  <div id="box">You MUST Click Submit to Send a Request</div>
</body>
</html>
 
 
---------------------------------------------------
 
Content of myserv.php
 
<?php
// Include the API binding
require_once 'oaapi.php';
// Set up a new instance of the API binding
$oaapi = new OAAPI('GamgSqGWzz5FGdQ6zVATqEir');
$function = $_GET['function'];
$output_type = $_GET['output_type'];
$data = $_GET['textfield'];
$search = $_GET['search'];
// Open Australia API Call
$mps = $oaapi->query($function, array('output' => $output_type, $search => $data));
// Output Result
echo $mps;
?>
 
--------------------------------------------------
 
So far it kind of works.....
 
But how the heck do I format the output into something usable?
The cryptic hints at the open australia api didnt help much.
 
I see a couple of examples on how others have implimented the api and I'm dissapointed at not being able to do so without some help.
 
By the way.. Im a total noob.  Im a code cut and paster. (not a real programmer) This is the first time I have tried to use jquery..
 
Thanks in Advance for any help. 
Reply all
Reply to author
Forward
0 new messages