Skip to content

Instantly share code, notes, and snippets.

@snarfed
snarfed / functions.php
Created June 12, 2022 15:56
snarfed.org custom theme functions.php, based on Ryu
<?php
/*
* Customizations for snarfed.org on top of the Ryu WordPress theme.
* Not (yet) a full child theme.
* Public domain.
*
* To log: dlog("xyz")
* Defined below. Wraps error_log(). Writes to wp-content/debug.log
*
* Requires WP_DEBUG and WP_DEBUG_LOG to be true in wp-config.php. Details:
curl -H 'Cookie: sessionid=...' -H 'X-IG-App-ID: 936619743392459' 'https://i.instagram.com/api/v1/users/web_profile_info/?username=...' -o ig.json
curl -v -F 'file=@ig.json;type=application/json' 'https://granary.io/scraped?site=instagram&output=mf2-json'
Verifying that +snarfed is my blockchain ID. https://onename.com/snarfed
100000425059588:925464134144413:10101869104476441_925497984141028
100000425059588:925493347474825:10101869104476441_925495704141256
100000425059588:925493347474825:10101869104476441_925495887474571
100001501388539:844774702249235:10101869104476441_844774922249213
100001501388539:844774702249235:10101869104476441_844775355582503
100001501388539:844774702249235:10101869104476441_844778915582147
100001501388539:844774702249235:10101869104476441_844780165582022
100001501388539:844774702249235:10101869104476441_844780415581997
100001501388539:844774702249235:10101869104476441_844780702248635
100001501388539:844774702249235:10101869104476441_845000628893309
@snarfed
snarfed / functions.php
Created July 14, 2014 14:54
use wordpress-webmention hook to add rel-syndication links for bridgy publish
/** When I POSSE a post with Bridgy Publish, add a rel-syndication URL.
*/
function bridgy_publish_syndication_link($response, $source, $target) {
$json = json_decode(wp_remote_retrieve_body($response));
dlog($target);
dlog($json);
dlog($response);
if (!is_wp_error($response) && $json &&
(strpos($target, 'localhost:8080/publish/facebook') ||
strpos($target, 'localhost:8080/publish/twitter'))) {
We couldn’t find that file to show.