* let's see if we can pull a list of tickets from the tracker..
*
*/
+
+GI = imports.gi.GIRepository
GLib = imports.gi.GLib;
+
+// we add this in, as it appears to get lost sometimes if we set it using the ENV. variable in builder.sh
+GI.IRepository.prepend_search_path(GLib.get_home_dir() + '/.Builder/girepository-1.1');
+
Soup = imports.gi.Soup ;
},
- fetchBugs : function()
+ fetchBugs : function(url)
{
+ Tickets.parseNetrc();
+ var ar = url.split('/');
+ print(JSON.stringify(ar, null, 4));
+ var auth = new Soup.Auth()
var session = new Soup.SessionSync();
-
- var status = session.send_message(
- new Soup.Message({
+ session.signal.authenticate.connect(function(sess, msg, auth, rt) {
+ //print("authenticate?");
+ auth.authenticate(
+ Tickets.machines[ar[2]].login,
+ Tickets.machines[ar[2]].password
+ );
+ });
+ var request = new Soup.Message({
method:"GET",
- uri:new Soup.URI.c_new("http://roojs.com/mtrack.php/Bugs")
- })
- );
+ uri:new Soup.URI.c_new(url)
+ });
+ var status = session.send_message(request);
var data = request.response_body.data;
- print(data);
+ return JSON.parse(data).data;
}
}
-Tickets.parseNetrc();
+
//print ( JSON.stringify(Tickets.machines) );
-Tickets.fetchBugs();
+
+
+
+//Tickets.fetchBugs("http://www.roojs.com/mtrack/index.php/Gitlive/web.hex");
+
\ No newline at end of file