Tasks API implementation into the PHP Client for Makerlog
Tasks API implementation into the PHP Client for Makerlog
In my spare time I build a PHP client for Makerlog. Makerlog is the dead-simple task log that helps you stay productive and ship faster. There you can meet other makers and share your progress.
At the moment there is no PHP client, so I decided to change this a few weeks ago.
Today I integrated the basic Task API into the client.
Repository
- https://github.com/pcsg/pcsg-makerlog-php-client
- Licence: GPL-3.0+
New Features
- What feature(s) did you add?
Almost the complete Task API
- How did you implement it/them?
The implementation is done with the following commits
- feat: new sync method; feat: started new Task Object; feat: /issues/4
- feat: create tasks
- feat: delete a task
- feat: getter and task data integrated
In addition, I have written a basic documentation so that you can use it.
Since documentation is more important to most people than the implementation of the client. Let me give you an overview how to use the client.
- Basically there is a central
Tasksobject which can be used to get Tasks and which can be used to create Tasks. - Additionally there is the single
Task.
How to get the main Tasks Object
The main Tasks object is directly available via the makerlog client
<?php
use PCSG\Makerlog\Makerlog;
$Makerlog = new Makerlog([
'client_id' => 'YOUR_CLIENT_ID',
'client_secret' => 'YOUR_CLIENT_SECRET',
'access_token' => 'ACCESS_TOKEN_FROM_THE_USER'
]);
$Tasks = $Makerlog->getTasks();
Create a Task
To create a new task, you must use the tasks object.
For the sake of simplicity I assume that the makerlog object is already instantiated and in my examples I won't do that again.
<?php
$Makerlog->getTasks()->createTask('COUR CONTENT', $options);
The options of a task are optional but can have the following values:
<?php
$options = [
"done" => false, // bool
"in_progress" => false // bool
];
Get tasks
Returns a list of all tasks in Makerlog.
<?php
$list = $Makerlog->getTasks()->getList();
Get a task
A single task can be received via its id
<?php
$task = $Makerlog->getTasks()->get(892); // get task via ID
With a normal task which has been received via get(), no operations can be executed. If you want to change the task, you should get a task object. This can be done via getTaskAsObject().
<?php
$Task = $Makerlog->getTasks()->getTaskAsObject(892); // get task via ID
// delete the task
$Task->delete();
// praise the task
$Task->praise(100);
A task object has several getter methods, so it is quite easy to access the data of the task.
<?php
$Task = $Makerlog->getTasks()->getTaskAsObject(892); // get task via ID
// main data
$Task->getId();
$Task->getContent();
// dates
$Task->getCreationDate();
$Task->getDoneDate();
$Task->getLastUpdateDate();
$Task->getCommentCount();
// is methods
$Task->isDone(); // returns true if the task is done
$Task->isInProgress(); // returns true if the task is in progress
GitHub Account
Makerlog and the client itself is still at the beginning. Many functions are still missing. But if you want to use the client, you can have a look at the examples.
With the changes and features of today it is now possible to create, delete tasks, praise other tasks and read tasks. :-)
Have fun in Makerlog and thanks for reading,
Hen
Leave Tasks API implementation into the PHP Client for Makerlog to:
Read more #utopian-io posts
Best Posts From π·π΄π½ π‘
We have not curated any of dehenne's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From π·π΄π½ π‘
- Kombo: Tamed Mammoth + Auric Rush - Gods Unchained
- Kombo: Uncanny Rogue und die Deadly Bombs - Gods Unchained
- Kombo: Patience Priestess + Battle Cleric - Gods Unchained
- Kombo: Marsh Walker + Guerilla Training - Gods Unchained
- MarktplΓ€tze / Exchanges fΓΌr Gods Unchained
- Sanctum & Favor ist hier
- Gods Unchained β Wo bekomme ich Informationen her?
- hier gibt es nichts zu sehen
- Gods Unchained - Das Online-Sammelkartenspiel
- Product API implementation into the PHP Client for Makerlog
- Projects API implementation into the PHP Client for Makerlog
- Tasks API implementation into the PHP Client for Makerlog
- Automation Scripts for Developers and Makers
- The Awesome Visiblity List
- STEEM To File Upload - Utopian Hackathon submission
- Loading a file into the STEEM blockchain
- Post the 'Daily SPN News bulletin' into the Discord
- STEEMPUNK-NET REST API and Discord Bot Extension
- Welcome Messages for new Users
- Fix for a backend error in the QUIQQER Open Source System