jdolitsky / AppDotNetPHP

PHP library for the App.net Stream API
34 stars 19 forks source link

It's full of stars #20

Closed ghost closed 11 years ago

ghost commented 11 years ago
/**
 * Star a post
 * @param integer $post_id The post ID to star
 */
public function starPost($post_id=null) {
    return $this->httpPost($this->_baseUrl.'posts/'.urlencode($post_id).'/star');
}   

/**
 * Unstar a post
 * @param integer $post_id The user ID to unstar
 */
public function unstarPost($post_id=null) {
    return $this->httpDelete($this->_baseUrl.'posts/'.urlencode($post_id).'/star');
}       

/**
 * List the posts started by the current user
 * @return array An array of associative arrays, each representing one starred post.
 */
public function getStarred($user_id=null) {
    return $this->httpGet($this->_baseUrl.'users/'.$user_id.'/stars');
}   
ravisorg commented 11 years ago

Dude! Pull requests! ;)

ravisorg commented 11 years ago

Also, cool, thank you, added to the master.

And I think we need a new rule that every commit needs to have a quote or something in the first line instead of just the commit notes :D

ghost commented 11 years ago

I pull someone to cut and paste that. 15 years using mks or svn ... git someday later.

On Sep 8, 2012 11:24 AM, "ravisorg" notifications@github.com wrote:

Dude! Pull requests! ;)

— Reply to this email directly or view it on GitHub.

ravisorg commented 11 years ago

hahahahaha yeah same here, but git wasn't actually that hard to learn. I still use SVN for most things tho.

jdolitsky commented 11 years ago

killin it guys, thanks a bunch

ghost commented 11 years ago

Do you think you can show me an example of formatting a simple annotation and creating a new post with it using createPost ?

I am screwing something up. :P

Harold http://hxf148.com

On Sat, Sep 8, 2012 at 1:42 PM, Josh Dolitsky notifications@github.comwrote:

killin it guys, thanks a bunch

— Reply to this email directly or view it on GitHubhttps://github.com/jdolitsky/AppDotNetPHP/issues/20#issuecomment-8392782.

ravisorg commented 11 years ago

Sure, here's a direct copy/paste from priv.im:


// store the message, session key in the annotations
$data = array(
    'text'=>$text,
    'annotations'=>array(
        array(
            'type'=>'im.priv',
            'value'=>array(
                'version'=>'1',
                'session_keys'=>$sessionData,
                'signature'=>null,
                'message'=>$message,
            ),
        ),
    ),
);

if ($replyTo) {
    $data['reply_to'] = $replyTo;
}

$result = $app->createPost($text, $data);
ghost commented 11 years ago

Thanks this helped me see that I was trying to make myself crazy with a } instead of ) .

Thanks for your help. Appeio now has geo annotation support.

I really want to support your PM system though.

Harold http://hxf148.com

On Sun, Sep 9, 2012 at 7:07 PM, ravisorg notifications@github.com wrote:

Sure, here's a direct copy/paste from priv.im:

// store the message, session key in the annotations$data = array( 'text'=>$text, 'annotations'=>array( array( 'type'=>'im.priv', 'value'=>array( 'version'=>'1', 'session_keys'=>$sessionData, 'signature'=>null, 'message'=>$message, ), ), ),); if ($replyTo) { $data['reply_to'] = $replyTo;} $result = $app->createPost($text, $data);

— Reply to this email directly or view it on GitHubhttps://github.com/jdolitsky/AppDotNetPHP/issues/20#issuecomment-8410471.