Skip to content

suphiyasin/Dev.to-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hits

Usage

First we need to include src.php. Then you need to enter Cookie and username

<?php
include("src.php");
$use = new devto();
$use->cookie = 'COOKIE';
$use->username = "YOUR USERNAME FROM dev.to";

then you can use whatever function you want to use

Examples


User Follow / Unfollow :
 <?php
include("src.php");
$use = new devto();
$use->cookie = 'COOKIE';
$use->username = "YOUR USERNAME FROM dev.to";
echo $use->follow("suphi", "follow");
// or echo $use->follow("suphi", "unfollow");

Get Shared Posts:

 <?php
include("src.php");
$use = new devto();
$use->cookie = 'COOKIE';
$use->username = "YOUR USERNAME FROM dev.to";
sa = $use->getposts();
foreach($sa as $as){
	echo 'Link : <a href="https://dev.to'.$as['path'].'" target="_blank">https://dev.to'.$as['path'].'</a><br/>
	ID : '.$as['id'].'<br/><hr/><br/>';
}

Create Comment :

 <?php
include("src.php");
$use = new devto();
$use->cookie = 'COOKIE';
$use->username = "YOUR USERNAME FROM dev.to";
$use->createComment("comment, nice!", "https://dev.to/suphi/new-generation-buy-me-coffee-3c7i");  

Edit Profile :

 <?php
include("src.php");
$use = new devto();
$use->cookie = 'COOKIE';
$use->username = "YOUR USERNAME FROM dev.to";
$use->editProfile("Name(*)", "Maıl Adress(*)", "username(*)", "Bio", "Location", "https://website.com");

React Message:

 <?php
include("src.php");
$use = new devto();
$use->cookie = 'COOKIE';
$use->username = "YOUR USERNAME FROM dev.to";
//react a 'like', 'unicorn', 'readinglist'
$use->reactmessage("https://dev.to/suphi/new-generation-buy-me-coffee-3c7i", "unicorn"); 

Create Post:

include("src.php");
$use = new devto();
$use->cookie = 'COOKIE';
$use->username = "YOUR USERNAME FROM dev.to";
//Important: Your other content cannot have the same body as this content.
echo $use->createPost("Title", "Text - Body", "Hashtag, list, suphi");

For TR => https://suphi.org/?p=78

Releases

No releases published

Packages

No packages published

Languages