Wykop API (V3) Swagger Documentation
composer require fakecop/wykop-client
php artisan wykop-client:install
- Config file will be added (wykop-client.php)
- Service provider will be registered (WykopClientServiceProvider.php)
- No migrations
- No models
- No resources
WYKOP_API_URL=https://wykop.pl/api/v3
WYKOP_KEY=w123xxxxxxx
WYKOP_SECRET=98a7sd9a8sdxxxxxxxxxxxxxxxxxxx
WykopClient facade available |
---|
use FakeCop\WykopClient\Facades\WykopClient;
...
$data = WykopClient::getProfile('green_martin');
dd($data);
Example result:
array:1 [
"data" => array:23 [
"username" => "green_martin"
"gender" => "m"
"company" => false
"avatar" => "https://wykop.pl/cdn/c3397992/green_martin_5rDzT7Nqab.jpg"
...
getProfile(string $username): array;
getProfileShort(string $username): array;
getProfileActions(string $username): array;
getProfileEntriesAdded(string $username): array;
getProfileEntriesVoted(string $username): array;
getProfileEntriesCommented(string $username): array;
getProfileLinksAdded(string $username): array;
getProfileLinksPublished(string $username): array;
getProfileLinksUp(string $username): array;
getProfileLinksDown(string $username): array;
getProfileLinksCommented(string $username): array;
getLinkList(
int $page = 1,
int $limit = 25,
?LinkSort $sort = null,
?LinkType $type = null,
?string $category = null,
?string $bucket = null
): array;
getLinkUrl(string $url): array;
getLink(int $linkId): array;
getLinkUpVotes(int $linkId, ActionType $type): array;
getLinkRedirect(int $linkId): array;
getLinkCommentList(
int $linkId,
int $page = 1,
int $limit = 25,
?CommentSort $sort = null,
bool $ama = false
): array;
getLinkComment(int $linkId, int $commentId): array;
getLinkCommentComments(int $linkId, int $commentId, int $page = 1): array;
getHitLinks(int $year, int $month, HitSort $sort = HitSort::ALL): array;
getHitEntries(int $year, int $month, HitSort $sort = HitSort::ALL): array;
getSearchAll(
string $query,
?Carbon $dateFrom = null,
?Carbon $dateTo = null,
SearchSort $sort = SearchSort::SCORE,
SearchVote $votes = SearchVote::HUNDRED,
array $domains = [],
array $users = [],
array $tags = [],
?string $category = null,
?string $bucket = null
): array;
getSearchLinks(
string $query,
?Carbon $dateFrom = null,
?Carbon $dateTo = null,
SearchSort $sort = SearchSort::SCORE,
SearchVote $votes = SearchVote::HUNDRED,
array $domains = [],
array $users = [],
array $tags = [],
?string $category = null,
?string $bucket = null,
int $page = 1,
int $limit = 25
): array;
getSearchEntries(
string $query,
?Carbon $dateFrom = null,
?Carbon $dateTo = null,
SearchSort $sort = SearchSort::SCORE,
SearchVote $votes = SearchVote::HUNDRED,
array $domains = [],
array $users = [],
array $tags = [],
?string $category = null,
?string $bucket = null,
int $page = 1,
int $limit = 25
): array;
getSearchUsers(
string $query,
SearchUsersSort $sort = SearchUsersSort::SCORE,
array $users = [],
int $page = 1
): array;
use FakeCop\WykopClient\Api\Requests\Contracts\LinkSort;
LinkSort::NEWEST; // 'newest'
LinkSort::ACTIVE; // 'active'
LinkSort::COMMENTED; // 'commented'
LinkSort::DIGGED; // 'digged'
use FakeCop\WykopClient\Api\Requests\Contracts\LinkType;
LinkType::HOMEPAGE; // 'homepage'
LinkType::UPCOMING; // 'upcoming'
use FakeCop\WykopClient\Api\Requests\Contracts\CommentSort;
CommentSort::NEWEST; // 'newest'
CommentSort::OLDEST; // 'oldest'
CommentSort::BEST; // 'best'
use FakeCop\WykopClient\Api\Requests\Contracts\ActionType;
ActionType::UP; // 'up'
ActionType::DOWN; // 'down'
use FakeCop\WykopClient\Api\Requests\Contracts\HitSort;
HitSort::ALL; // 'all'
HitSort::DAY; // 'day'
HitSort::WEEK; // 'week'
HitSort::MONTH; // 'month'
HitSort::YEAR; // 'year'
use FakeCop\WykopClient\Api\Requests\Contracts\SearchSort;
SearchSort::SCORE; // 'score'
SearchSort::POPULAR; // 'popular'
SearchSort::COMMENTS; // 'comments'
SearchSort::NEWEST; // 'newest'
use FakeCop\WykopClient\Api\Requests\Contracts\SearchVote;
SearchVote::FIFTY // 50
SearchVote::HUNDRED // 100
SearchVote::FIVE_HUNDRED // 500
SearchVote::THOUSAND; // 1000
use FakeCop\WykopClient\Api\Requests\Contracts\SearchUsersSort;
SearchUsersSort::SCORE // 'score'
SearchUsersSort::NEWEST // 'newest'