Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evref-bl/wordpress-pharo-api
https://github.com/evref-bl/wordpress-pharo-api
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/evref-bl/wordpress-pharo-api
- Owner: Evref-BL
- Created: 2024-07-24T08:23:09.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T12:12:31.000Z (5 months ago)
- Last Synced: 2024-08-03T11:11:19.505Z (5 months ago)
- Language: Smalltalk
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wordpress-Pharo-API
This is a client for the [WordpressAPI](https://developer.wordpress.org/rest-api/reference/posts/).
## Installation
```st
Metacello new
githubUser: 'Evref-BL' project: 'Wordpress-Pharo-API' commitish: 'main' path: 'src';
baseline: 'WordpressPharoAPI';
load
```## Connect the API to Wordpress
The first step before querying is to connect to the Wordpress API.
```smalltalk
wordpressAPI := WordpressPharoAPI new.
wordpressAPI endpoint: ''.
wordpressAPI username: '' password: ''.
```## Example
### Get recent posts
```smalltalk
wordpressAPI getPosts
```### Publish a post
```smalltalk
myPost := WPPost new.
myPost date: DateAndTime tomorrow.
myPost status: 'draft'.
myPost title: 'FirstTest'.
myPost author: 28.
myPost content: 'First content'.wordpressAPI createPost: myPost.
```