[p2pu-dev] P2PU Primitives

Dan Diebolt dandiebolt at gmail.com
Tue Oct 25 12:40:00 UTC 2011


This is very crude and has some conceptual mistakes but you can grab some
more entities by looking at this list:

https://gist.github.com/1291496#file_conceptual+p2_pu+api+get+methods

I think the major entities not on your list are:


   1. user profile, vcard
   2. badge (skill, value, community,osqa)
   3. stream
   4. tag
   5. social graph (digraph of followers / following relationship)
   6. {Badges, Learning Plan, Interests,  Future Courses} (narrative, url or
   list of tags)
   7. {BackPack, Portfolio} (bag of Badges)
   8. {ExternalResource, WorkProduct, Evidence} (bag of links / bag of
   evidence)
   9. ToolBox (bag of resources links and narrative)
   10. Message
   11. Comment

I actually created a mock API for many of the Getters on my list extracting
content from specific P2PU pages. In one of my other posts I posted a JSON
response. So given a specific profile page, you can snag a member's
interests out of the page with small snippets of client side code:

   var member_interests = $("#sidebar div.vcard
h3:contains(Interests)",page).next("ul.interests").find("li
a").map(function(){
    return [{name: $.trim($(this).text()),
             url: fixurl($(this).attr("href"))}];
   }).get();

It may seem kind of strange to approach it this way whn there is already a
model within Lernana but it much faster to conceptualize, prototype and mock
data for missing API methods. You can even do more obscure stuff like grab
the staff (GetStaff API method) out of the "about" page:

var staff;
$.ajaxSetup({async: false});
var url = "http://p2pu.org/en/pages/about/";
$.get(url,function(page){
 staff = $("#member_relationships li",page).map(function(){
 return [[{profile: $("a",this).attr("href"),
           name:  $.trim($("a",this).attr("title").split(", ")[0]),
           title: $.trim($("a",this).attr("title").split(",
").slice(1).join(", ")),
           image: $("a img",this).attr("src")
        }]];
 }).get();
 console.log(staff);
});

Which returns a structure similar to this:

image: "/media/images/staffs/philipp.jpg"
name: "Philipp Schmidt"
profile: "http://new.p2pu.org/en/Philipp"
title: "Director"

In any event I think you should set up something more than email as a lot of
conceptualization and prototyping has to play out to come up with a good API
(and to define what the goals are in the first place - support integration
with xxx, support course feature yyy, etc).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p2pu.org/pipermail/p2pu-dev/attachments/20111025/df831003/attachment.html>


More information about the p2pu-dev mailing list