Skip to content

Instantly share code, notes, and snippets.

View pfefferle's full-sized avatar
😴
zzZZzzzZzzZZzZZZ

Matthias Pfefferle pfefferle

😴
zzZZzzzZzzZZzZZZ
View GitHub Profile
@pfefferle
pfefferle / rss.gs
Last active November 8, 2022 20:53
function doGet() {
// What is the original language of the RSS Feed
var fromLang = "de";
// What is the destination language
var toLang = "en";
// Enter the full URL of the RSS feed
var rssFeed = "https://notiz.blog/feed/";
# | |___ _| |___ _| |_
# | __\ \ /\ / / __\ \/ / __|
# | |_ \ V V /| |_ > <| |_
# \__| \_/\_/ \__/_/\_\\__|
#
# Twtxt is an open, distributed
# microblogging platform that
# uses human-readable text files,
# common transport protocols, and
# free software.
{
"tests": "10825",
"failures": "0",
"errors": "3",
"time": "164.350793",
"testsuites": {
"WP_REST_Plugins_Controller_Test": {
"name": "WP_REST_Plugins_Controller_Test",
"tests": "36",
"failures": "0",
@pfefferle
pfefferle / identity-toolkit.php
Created January 10, 2012 17:46
A "Google Identity Toolkit" Demo-WordPress-Plugin
<?php
/*
Plugin Name: Identity Toolkit Demo
Plugin URI:
Description: a quick and dirty Identity Toolkit-plugin
Version: demo
Author: Matthias Pfefferle
Author URI: http://notizblog.org/
*/
function webmention_url_to_postid( $url ) {
$id = wp_cache_get( base64_encode( $url ), 'webmention_url_to_postid' );
if ( $id ) {
return apply_filters( 'webmention_post_id', $id, $url );
}
if ( '/' === wp_make_link_relative( trailingslashit( $url ) ) ) {
return apply_filters( 'webmention_post_id', get_option( 'webmention_home_mentions' ), $url );
}
@pfefferle
pfefferle / blavatars.php
Created February 2, 2012 16:35
Blog Avatar
<?php
/*
Plugin Name: Blavatars
Plugin URI: https://gist.github.com/1724438
Description: Use Gravatar as a blogs avatar (Web Clip, Favicon, ...)
Version: 0.1
Author: Matthias Pfefferle
Author URI: http://notizblog.org/
*/
<?php
// get private key
$key = get_user_meta( 1, 'magic_sig_private_key', true );
$date = gmdate('D, d M Y H:i:s T');
$signed_string = "(request-target): post /inbox\nhost: mastodon.social\ndate: $date";
$signature = null;
openssl_sign( $signed_string, $signature, $key, OPENSSL_ALGO_SHA256 );
$signature = 'keyId="https://pfefferle.org/author/pfefferle/#main-key",algorithm="rsa-sha256",headers="(request-target) host date",signature="' . base64_encode( $signature ) . '"';
{
"items": [
{
"type": [
"h-feed"
],
"properties": {
"name": [
"test"
],
{
"items": [
{
"type": [
"h-entry"
],
"properties": {
"in-reply-to": {
"type": [
"h-cite"