Wordpress-Pharo-API

Details

Source
GitHub
Dialect
pharo (25% confidence)
Created
July 24, 2024
Updated
Sept. 4, 2024

README excerpt

# 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: '<mywordpress>'.
wordpressAPI username: '<myusername>' password: '<mypassword>'.
```

## 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.
```
← Back to results