This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
There are some problems with this, use https://github.com/cogdog/wp-posted-today instead. | |
*/ | |
/* | |
* Plugin Name: OnThisDay | |
* Description: shortcode for posts on the current day | |
* Version: 0.1 | |
* Author: John Johnston | |
* Mostly borrowed from https://wordpress.stackexchange.com/questions/53462/on-this-day-php-code/53761 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* RSS2 Feed Template for displaying RSS2 Posts feed. | |
* Modified for microcast | |
* Based on template found https://css-tricks.com/roll-simple-wordpress-podcast-plugin | |
* | |
*/ | |
$numposts = 50; // number of posts in feed | |
$posts = query_posts('showposts='.$numposts.'&cat=652'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--needs json helper for apple script Free from mac app store | |
--https://itunes.apple.com/gb/app/json-helper-for-applescript/id453114608?mt=12 | |
set downloadfolder to POSIX path of (choose folder with prompt "Please select an output folder:") | |
set pagecountstart to 1 | |
set pagecountmax to 1 | |
set perpage to 10 --MAX =100 | |
set blogurl to "FILL-IN-THE-URL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set myDate to current date | |
set myNewDate to myDate - (8 * days) | |
tell application "JSON Helper" | |
set links to fetch JSON from "https://feeds.pinboard.in/json/u:johnjohnston/" | |
--set links to fetch JSON from "https://feeds.pinboard.in/json/u:johnjohnston/t:classroom" | |
set y to count of links | |
set linkstopost to "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.open('data:text/html, %3Chtml%20contenteditable%3E%3Cstyle%3E%2A%7Bfont-size%3A20px%7D%3C%2Fstyle%3E','_blank') | |
//window.open('data:text/html, <html contenteditable><style>*{font-size:20px}</style>','_blank') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--mp3s have been downloaded and then uploaded to a folder on the web | |
--I could not manage to create enclosures on blog posts with AppleScript | |
global myBlogUsername, myBlogPass, myBlogPass, boonote, mp3uploadfolder, boojson | |
set myBlogUsername to "USERNAME" | |
set myBlogPass to "PASSWORD" | |
set boonote to "<em>This audio file was orginally posted to AudioBoo(m) with the mobile app. It has been downloaded and posted here since audioboom no longer supports free accounts.</em>" | |
set mp3uploadfolder to "http://johnjohnston.info/exboos/" | |
set boojson to (read POSIX file "Users/john/Desktop/audioboom/johnjohnston.json") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set downloadfolder to "/Users/john/Desktop/audioboom/edutalk/" | |
--so this next bit could be a loop but doing it manual was not much of a hassle | |
set pagecount to 9 | |
set tag to "edutalk" | |
set itemcount to 100 | |
tell application "JSON Helper" | |
set bURL to "https://api.audioboom.com/tag/" & tag & "/audio_clips?page[items]=" & itemcount & "&page[number]=" & pagecount | |
set boos to fetch JSON from bURL | |
set myFile to open for access "Macintosh HD:Users:john:Desktop:audioboom:edutalk_" & pagecount & ".json" with write permission |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on alfred_script(q) | |
set myBlogUsername to "USERNAME" | |
set myBlogPass to "PASSWORD" | |
set cat to {category:{"Micro"}, kind:{"note"}} | |
set poststrut to {post_type:"post", post_status:"publish", post_format:"status", post_title:"", post_content:q, terms_names:cat, comment_status:"open"} | |
tell application "http://example.com/xmlrpc.php" | |
set myPosts to call xmlrpc {method name:"wp.newPost", parameters:{"1", myBlogUsername, myBlogPass, poststrut}} | |
return myPosts | |
end tell | |
end alfred_script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Opening PHP tag - nothing should be before this, not even whitespace | |
//Micro.blog// | |
/* | |
updated 2018-01-29 | |
this is just the micro.blog stuff I've added to my child theme's function php | |
Hopefully most of the credits are noted below | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on isRetina() | |
set ret to (do shell script "system_profiler SPDisplaysDataType | awk '/Retina:/{print $2}'") | |
if ret is "Yes" then | |
return true | |
else | |
return false | |
end if | |
end isRetina |