how to getPlurks

Sep 22, 2010 at 5:17 AM

I want to getPlurks in my application.

But , I was confused by the function "getPlurks"..

Would somebody write down some sample code for me?

Thanks..

Coordinator
Sep 27, 2010 at 3:55 PM
Edited Sep 27, 2010 at 3:57 PM

Example 1:  It is used to get plurks newer than offset ( 2010/09/27 00:00:00 ) and limited 50 number of plurks to be returned

Reference : http://www.plurk.com/API#/API/Polling/getPlurks

 

var api = new PlurkApi.PlurkApi("xxxxxxxx");

var userName = "usernamexxx"

 var passWord = "passwordxxx"

if (api.login(userName, passWord))

{

    plurks objs = api.getPlurks(new DateTime(2010, 9, 27, 0, 0, 0), 50);

    foreach (var plurk in objs)

    {

        Console.Write(plurk.content_raw);

    }

}

 


 

Example 2:  It is used to get plurks older than offset ( 2010/09/28 00:00:00 ) and limited 20 number of plurks to be returned

Reference : http://www.plurk.com/API#/API/Timeline/getPlurks

 

var api = new PlurkApi.PlurkApi("xxxxxxxx");

var userName = "usernamexxx"

 var passWord = "passwordxxx"

if (api.login(userNamepassWord))

{

    plurks objs = api.getPlurks(new DateTime(2010, 9, 28, 0, 0, 0), 20, string.Empty);

    foreach (var plurk in objs)

    {

        Console.Write(plurk.content_raw);

    }

}

 

Oct 11, 2010 at 11:23 AM
Edited Oct 11, 2010 at 11:24 AM

thank you for your help

but I also encounter problem in get plurk's response.

here is my code:

If VarPlurkAPI.login("usernameXXXXX", "passwordXXXXX") Then

           Dim myplurks As plurks = VarPlurkAPI.getPlurks(New Date(2010, 10, 11, 6, 0, 0), 30)
        For Each p In myplurks

           Console.WriteLine(p.id & "," & p.is_unread & "," & p.lang & "," & p.limited_to & "," & p.owner_id & "," & p.plurk_id & "," & p.plurk_type & "," & p.qualifier & "," & p.user_id & "," & p.posted & "," & p.content & "," & p.content_raw)

            ' Dim t As plurk = VarPlurkAPI.getPlurk(p.plurk_id)

            'Dim tt As PlurkApi.responses = VarPlurkAPI.getResponses(p.plurk_id, 30)

            Console.WriteLine(p.response_count)

            If p.response_count <> 0 Then

                Dim rep As responses = VarPlurkAPI.getAllResponses(p.plurk_id)
                For Each q In rep

                    Console.WriteLine(q.content & "," & q.lang & "," & q.qualifier & "," & q.user_id & "," & q.posted)

                Next

            End If

                    Next  

end if

 

i use VB.NET to complie it

Coordinator
Oct 26, 2010 at 7:28 AM

What's problem? Could you describe more detail about your problem? such like exception messages and others~

Nov 11, 2010 at 7:24 AM

I want to get yesterday's Plurk.

When I use function getPlurks, change offset value, result is the same...

how can I fixed ?

example :


PlurkApi.plurks ps = plurk.getPlurks( new DateTime(2010, 11, 11, 0, 0, 0), 50, string.Empty);

PlurkApi.plurks ps = plurk.getPlurks( new DateTime(2010, 11, 10, 0, 0, 0), 50, string.Empty);