Skip to content

Instantly share code, notes, and snippets.

Namespaces:
http://backend.userland.com/rss2
http://drupal.org/project/og
http://meo.pt/feed
http://my.netscape.com/rdf/simple/0.9/
http://pipes.yahoo.com
http://purl.org/atom-blog/ns#
http://purl.org/atom/ns#
http://purl.org/rss/1.0/
@russellbeattie
russellbeattie / get-links.js
Created August 14, 2023 21:30
Grab bookmarks and export as JSON
package feeds
var Ns = map[string]string{
// via http://feed2.w3.org/docs/howto/declare_namespaces.html
"http://a9.com/-/spec/opensearch/1.1/": "opensearch",
"http://a9.com/-/spec/opensearchrss/1.0/": "opensearch10",
"http://backend.userland.com/blogChannelModule": "blogChannel",
"http://backend.userland.com/creativeCommonsRSSModule": "creativecommons",
"http://backend.userland.com/creativeCommonsRssModule": "creativeCommons",
const https = require('https');
main();
async function main() {
let args = process.argv.slice(2);
let days = parseInt(args[0]) || 14;
let urlStr = 'https://www.cdc.gov/coronavirus/2019-ncov/json/new-cases-chart-data.json';
export default class Router {
constructor(){
this.routes = [];
this.current = null;
}
add(route, handler) {
let re = new RegExp(route + '$');
@russellbeattie
russellbeattie / dwitterish.html
Last active February 22, 2017 03:30
Dwitter.net practice page
<!DOCTYPE html>
<html>
<head>
<title>Dwitterish</title>
<style>
body{
background-color: #fff;
font-family: sans-serif;
}
.container{
@russellbeattie
russellbeattie / throttle.js
Last active August 18, 2016 01:47
A better, self-contained, JavaScript function throttle
function throttle(fn, limit, scope) {
var last;
var deferTimer;
return function() {
var context = scope || this;
var args = arguments;
@russellbeattie
russellbeattie / search-apple-mail-body.js
Created June 1, 2016 01:11
Searches Apple mail Inbox for your name (if your name is Russ - otherwise change that bit) in the latest message and logs out/marks yellow.
#!/usr/bin/env osascript -l JavaScript
function run(argv) {
var Mail = new Application("Mail");
var inbox = Mail.inbox();
var messages = inbox.messages();
@russellbeattie
russellbeattie / pubsubhubbub.txt
Last active April 8, 2016 19:32
Pubsubhubbub urls from of 50k feeds
Wordpress hubs are formatted like this: http://www.example.com/?pushpress=hub
17605 http://pubsubhubbub.appspot.com/
1493 http://hubbub.api.typepad.com/
797 http://tumblr.superfeedr.com/
185 http://superfeedr.com/hubbub
144 http://pubsubhubbub.appspot.com
103 http://posterous.superfeedr.com
103 http://www.pheedo.com/api/hub/
@russellbeattie
russellbeattie / aws-twitter-search-bot.js
Last active January 19, 2016 00:42
AWS Lambda Twitter Search Bot... uses S3 for persistence and SNS to send out messages.
var querystring = require('querystring');
var https = require('https');
var aws = require('aws-sdk');
var s3 = new aws.S3();
var sns = new aws.SNS({
region: 'us-east-1'
});
var query = '#SEARCH TERM HERE';