dracoblue / activitystreams-php Goto Github PK
View Code? Open in Web Editor NEWA activitystreams server and client in php.
A activitystreams server and client in php.
I could not find a method to delete a Activity, so I had to add a workaround.
It would be good to add the possibility to delete Activity by ID or by other fields inside the activity table, such as stream_id, actor_id, object_id, verb, and so on.
I needed this feature because I wanted to delete a activity without deleting the object from the database because it could be used by other activities.
So, in my Yii Framework component wrapper for the Activity Stream client, I've added the following method:
public function deleteActivityByValues($values=array()) { if (count($values)==0) return false; $criteria=new CDbCriteria(array( 'limit'=>1, )); $values['application_id']=$this->application_id; foreach ($values as $k => $v) { $criteria->addCondition("
$k=:$k"); $criteria->params[$k]=$v; } return ActivityStreamActivity::model()->deleteAll($criteria); }
And now I can call the following to delete a Activity from a certain Stream related to a certain Object:
Yii::app()->as->deleteActivityByValues(array( 'stream_id'=>$stream->getId(), 'object_id'=>$object->getId(), ));
If you subscribe again to a stream, the actor is subscribed twice. (reported by Alex).
Right now I've got a profile page where I show one users latest activities. At the bottom of the page there's a "load more" button that loads with ajax the next "page" of activities.
So the ajax call basically runs the getFeed method with a different offset.
The problem I find is that if in the meanwhile more activities were created, or were deleted, then when we load the new ones, we will either repeat some activities that were already shown, or we skip some activities that haven't been shown yet.
.. currently we have only a 500er saying that verb must not be null.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.