Skip to content

Instantly share code, notes, and snippets.

View aaronpk's full-sized avatar

Aaron Parecki aaronpk

View GitHub Profile
{
"type": [
"h-entry"
],
"properties": {
"author": [
{
"type": [
"h-card"
],
> url.parse('http://example.com/##example')
{ protocol: 'http:',
slashes: true,
auth: null,
host: 'example.com',
port: null,
hostname: 'example.com',
hash: '##example',
search: null,
query: null,
{
"type": [
"h-entry"
],
"properties": {
"bookmark": [
{
"type": [
"h-cite"
],
@aaronpk
aaronpk / parsed.json
Created February 24, 2015 16:23
Adding some microformats2 classes to an RSS 2.0 feed: http://scripting.com/rss.xml
{
"items": [
{
"type": [
"h-feed"
],
"properties": {
"name": [
"Scripting News"
@aaronpk
aaronpk / init-script
Created March 20, 2015 19:36
adjust paths appropriately
# This file goes in something like
# /etc/init/service-name
start on runlevel [2345]
stop on runlevel [016]
respawn
exec sudo -u www /full/path/to/start.sh >> /var/log/worker.log 2>&1
items:
- type:
- h-entry
properties:
author:
- type:
- h-card
properties:
name:
- Aaron Parecki
[
{
"x": 0,
"Foo": 12,
"Bar": 3
},
{
"x": 1,
"Foo": 24,
"Bar": 9
<tbody class="h-entry">
<tr class="athing">
<td align="right" valign="top" class="title">
<span class="rank">19.</span>
</td>
<td>
<center><a id="up_9443241" onclick="return vote(this)" href="vote?for=9443241&amp;dir=up&amp;auth=4f617c803a44687927291cd133ac825ca9e61c4b&amp;goto=news"><div class="votearrow" title="upvote"></div></a></center>
</td>
<td class="title">
<span class="deadmark"></span>
dataset = DB['INSERT INTO foo (bar) VALUES ?', :$bar]
dataset.prepare(:insert, :run_insert)
DB.call :run_insert, :bar => 100

Creating a Post

Creating a post, specifying properties from the microformats2 vocab. The type and properties map to the output of the Microformats 2 parsed result.

Form-encoded requests have a property h=* which specifies the type of object being created. All other properties are considered properties of the object being created.

h=entry&
content=hello+moon&
category[]=indieweb&amp;