User Tools

Site Tools


lemmy-php

Lemmy-PHP

A PHP class for Lemmy.

Getting Started

Create a new post

<?php
require("lemmy.class.php");
$url = "https://lemmy.glasgow.social"; 
$lemmy = new lemmy($url);
 
$auth_token = $lemmy->login("YOUR_USERNAME", "YOUR_PASSWORD");
 
$post['name'] = "Test Post";
$post['url'] = "https://glasgow.social";
$post['body'] = "A comment can go here";
$post['community_id'] = "5";
$post['auth'] = $auth_token;
 
$lemmy->createPost($post);
?>
lemmy-php.txt · Last modified: 2020/12/02 15:49 by neil