PHP code example of rivervanrain / indieweb

1. Go to this page and download the library: Download rivervanrain/indieweb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rivervanrain / indieweb example snippets



<i class="openwebicons-indieweb" style="font-size: 16px;"></i>

<i class="openwebicons-feed-colored" style="font-size: 20px;"></i>



/** Elgg\IndieWeb\Webmention\Client\WebmentionClient **/
$svc = elgg()->webmention;
$response = $svc->get($source);

/** Elgg\IndieWeb\Microsub\Client\MicrosubClient **/
$microsub_client = elgg()->microsub;
$microsub_client->sendNotification($webmention, $parsed);

/** \Elgg\IndieWeb\Cache\MediaCacher **/
$image = elgg()->mediacacher->saveImageFromUrl($author_value);

// Get the target guid
$target_guid = indieweb_get_guid($target);
$webmention->setMetadata('target_guid', $target_guid);
						
$target = indieweb_get_path($target);
$webmention->setMetadata('target', $target);