wykopaka/wykop-api-client

Client for Wykop API.

2.0.1 2023-09-03 15:18 UTC

This package is auto-updated.

Last update: 2024-04-15 22:12:40 UTC


README

This library provides you a client for a Wykop API v3.

Requirements

  • Wykop API Client works with PHP 5.5 or above.

Installation

Install the latest version with

composer require wykopaka/wykop-api-client:v2.x-dev

Documentation

Basic Usage

<?php

use WykopApiClient\WykopApi;

$apiClient = new WykopApi();
$apiClient->authorizeApp('APPKEY', 'APPSECRET');

Wykop Connect

Get Wykop Connect URL

$redirectUrl = $apiClient->wykopConnect->getUrl();
header('Location: ' . $redirectUrl);

Tags

Get entries from a tag.

$entries = $apiClient->tags->getEntries(
    'wykopaka' // Tag name.
);

foreach ($entries as $entry) {
    // ...
}

Entries

Post a new entry.

$entries = $apiClient->entries->post(
    'Message content', // Message contentn.
    'https://example.com/image.png', // Attachment URL.
    false // True if it is an adult only content.
);

Get user's entries.

$entries = $apiClient->profile->getEntries(
    'wykopaka' // Username.
);

foreach ($entries as $entry) {
    // ...
}

Profiles

Get user's profile.

$entries = $apiClient->profile->get(
    'wykopaka' // Username.
);