Coder Social home page Coder Social logo

appdotnetphp's People

Contributors

33mhz avatar berg avatar cdn avatar charlw avatar jdolitsky avatar martinstuecklschwaiger avatar neuroscr avatar ravisorg avatar wpstudio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appdotnetphp's Issues

new api functionality

//todo describe
public function getUserUnifiedStream($params = array()) {
    return $this->httpReq('get',$this->_baseUrl.'posts/stream/unified?'.$this->buildQueryString($params));
}


//todo describe
public function interactions($params = array()) {
    return $this->httpReq('get',$this->_baseUrl.'users/me/interactions?'.$this->buildQueryString($params));
}   

Mute / Unmute / Muted

I thought that you had added these... anyway I hacked these together but I am getting inconsistent results with Unmute... maybe it needs curl magic.

Cheers

// Mute user
function muteUser($user_id=null) {
    return $this->httpPost($this->_baseUrl.'users/'.$user_id.'/mute');
}   

//Unmute user
function unmuteUser($user_id=null) {
    return $this->httpDelete($this->_baseUrl.'users/'.$user_id.'/unmute');
}       

//List Muted
// Returns an array of User objects for users following the specified user.
function getMuted($user_id='me',$count=20,$before_id=null,$since_id=null) {
    return $this->httpGet($this->_baseUrl.'users/'.$user_id.'/muted?count='.$count.'&before_id='.$before_id.'&since_id='.$since_id);
}

Extended Post options

Any plans to update the lib to support passing the new @mentions flag and the other post options not implemented? I can do it but if someone else can that's good too. Thinking there will be a few API updates this week.

404 on unfollowUser ?

Follow seems to be working but unfollowUser is throwing 404 errors most of the time.. but sometimes I think it gets though. The url and user id(s) look ok.

Following / Followers pagination

So I was trying to get Following / Follower pagination working but I think I am confused on how the migration works.

  1. How do I enable the migration(s) .. an example?

  2. The lib needs this update (I think..) (parms)

    /**

    • Returns an array of User objects the specified user is following.
    • @param mixed $user_id Either the ID of the user being followed, or
    • the string "me", which will retrieve posts for the user you're authenticated
    • as.
    • @return array An array of associative arrays, each representing a single
    • user following $user_id
      */
      public function getFollowing($user_id='me',$params = array()) {
      return $this->httpGet($this->_baseUrl.'users/'.$user_id.'/following?'.$this->buildQueryString($params));
      }

    /**

    • Returns an array of User objects for users following the specified user.
    • @param mixed $user_id Either the ID of the user being followed, or
    • the string "me", which will retrieve posts for the user you're authenticated
    • as.
    • @return array An array of associative arrays, each representing a single
    • user following $user_id
      */
      public function getFollowers($user_id='me',$params = array()) {
      return $this->httpGet($this->_baseUrl.'users/'.$user_id.'/followers?'.$this->buildQueryString($params));
      }

Handled URLs on Post

May or may not be an issue with urls getting cut off, maybe not...

getSession()) { $app -> createPost('This is a test message with a url http://appeio,com?v=post&p=555',null); } ?>

UserID from Username?

Is there currently an API method I am not seeing or undocumented that makes it available to get a User ID from the Username? I don't really want to expose the id for internal app links.

What is the license of this code?

Is this code published under a free license? Which license is it?

Would love to re-use the code but would need at least a BSD compatible license to do so.

Error handling in getAccessToken()

Currently, getAccessToken() assumes that the call to access_token always returns a valid token. However, if the code has expired, has been used before, is incorrect or in a range of other cases, an error is returned instead.

setSession() ?

I'm using some of the basic code on the readme as well as the core appdotnet.php files.

It keeps going through a redirect loop. It looks as though the function setSession is never actually called, however. So the cookies don't get set and thus the loop is created. I'll see if I can fix this and put in a PR.

Set user's username [suggestion]

It would be great if the user's username was set (either in GLOBAL, _SESSION, or in the cookie).

That makes it easier to spot if a post is a reply, can be deleted, etc.

RateLimits and Scope

The getRateLimitRemaining() and associated functions don't seem to work.
Also need to add getScope.

Stream stops providing data after ADN server responds with keep-alive

I'm opening a stream using the ConsumeStream functions, however as soon as it goes 'quiet', i.e. no data is coming through, ADN servers respond every 60 seconds with:

HTTP/1.1 200 OKServer: nginx/1.2.6Date: Mon, 11 Mar 2013 21:29:27 GMTContent-Type: text/html; charset=UTF-8Transfer-Encoding: chunkedConnection: keep-alive

As soon as the class receives this, no new data will come through. I can see ADN objects coming through previous to this message, and can post them myself, but they instantly stop as soon as the keep-alive arrives.

How can we fix this issue?

Return data from createFile() appears to be getting lost.

$ok = $app->createFile($file, array('metadata' => 'file.type'); leaves me with nothing in $ok

$ok2 = $app->getLastResponse(); called afterwards clearly shows expected return data with file id and token.

Has anyone else seen this?

It's full of stars

/**
 * 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');
}   

Posting to app.net

Hi,

Can you show a working example for posting a new message / reply to app.net? I have tried.. but have only gotten 401 unauthorized back. I think I am missing something as I can read streams and login. http://appeio.com

Cheers,
Harold

Whitespace 2 space vs tab?

any one have any problems with me converting the files over to using 2 space for indentation instead of tabs?

Undefined variables

Was getting errors
Notice: Undefined variable: redirectUri in /EZAppDotNet.php on line 48

Notice: Undefined variable: scope in /EZAppDotNet.php on line 48

Here's the diff, not sure of the best way to submit it

$ diff AppDotNet.php ~/git/AppDotNetPHP/AppDotNet.php 
79d78
< global $app_redirectUri;
89c88
<               'redirect_uri'=>$app_redirectUri,

---
>               'redirect_uri'=>$this->_redirectUri,

$ diff EZAppDotNet.php ~/git/AppDotNetPHP/EZAppDotNet.php 
34c34
<       global $app_redirectUri,$app_scope;

---
> 
48c48
<       parent::__construct($clientId,$clientSecret,$app_redirectUri,$app_scope);

---
>       parent::__construct($clientId,$clientSecret,$redirectUri,$scope);
60c60
<       return parent::getAuthUrl($redirectUri);

---
>       return parent::getAuthUrl();

createChannel - $pm not declared and is not necessary

The $pm variable is not declared in this scope, and given that the function may not be used to create a PM channel, the ternary clause is unnecessary.

return $this->httpReq('post',$this->_baseUrl.'channels'.($pm?'/pm/messsages':''), $json, 'application/json');

With this version, however:

return $this->httpReq('post',$this->_baseUrl.'channels', $json, 'application/json');

with this data object:

{"type":"ca.roaringsky.group","writers":{"immutable":"0","public":"0","user_ids":"10403","73417"]}}

the call fails to complete. Suggestions?

Lib changes

Hi,

I am right now going to learn how to properly do a pull request so I can do this properly but in case I fail..

I've been trying to get back in line with AppDotNetPHP proper before the Streaming stuff but I've made a couple of small changes since last syncing up.

Mostly I added two functions:

getId, which is an API supported way to get an ID (user object) when you only know the username.

getTokenStream, this is a way to pass in a token other than the authed users to get a different stream.

This was in order to make @teawithcarls "View Accounts" work with Appeio. In order to get this to work I also had to changed httpReq slightly. I realize this is a bit specific but not too bad..

I think that's the only diffs.

Trying out SmartGit and some other softwares.

Err in getFollowers

Line 412: missing a ? mark.

return $this->httpGet($this->_baseUrl.'users/'.$user_id.'/followers'.http_build_query($params));

should be

return $this->httpGet($this->_baseUrl.'users/'.$user_id.'/followers?'.http_build_query($params));

Auth not working

I'm following the instructions in the readme for AppDotNet.php auth. The first part works fine. But when I approve the app and it returns to my callback URL, $_GET['code'] is set but both $token and $user are NULL.

getPost working?

Hi,

Can you or anyone confirm that getPost works? I get an internal error?

I'll send you in my changes to AppDotNetPHP asap. It's a bit of a mess right now.

Cookies, Sessions ...

Hey guys,

I know there have been some exchanges on this but what can we do to implement solid cookie session setting support into the library directly? Before I go off and try to hack something together maybe better expertise can do it and help make it standard for apps using this lib.

Cheers,

Harold

Smarter function calls

Thinking about this. Maybe AppDotNet class should be straight dumb calls and EZ should a smarter wrapper that makes the API easier to deal with. This would give the advantage if you already knew/want to the learn the ADN API you can use straight AppDotNet and anything specific to our upgrade would be in EZ.

This would revert the change to getFile and getFiles to make them 2 different web calls but then EZ would have a function that takes one or more IDs and be smarted enough to make the appropriate backend call.

Move scope to settings

At the moment, the default scope is to get everything

$scope=array('stream','email','write_post','follow','messages','export')) {

I don't disagree with that, but I think it should be moved into EZsettings, so that developers don't overlook it. I've already been burned by someone complaining that I wanted their email.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.