CINXE.COM

Improving the php-mf2 parser – Microformats

<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <link rel="shortcut icon" type="image/ico" href="/favicon.ico" /> <link rel="profile" href="http://microformats.org/profile/specs" /> <link rel="profile" href="http://microformats.org/profile/hatom" /> <title>Improving the php-mf2 parser &#8211; Microformats</title> <link rel='dns-prefetch' href='//s.w.org' /> <link rel="alternate" type="application/rss+xml" title="Microformats &raquo; Feed" href="https://microformats.org/feed" /> <link rel="alternate" type="application/rss+xml" title="Microformats &raquo; Comments Feed" href="https://microformats.org/comments/feed" /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/microformats.org\/wordpress\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.4.16"}}; /*! This file is auto-generated */ !function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])?!1:!s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([55357,56424,55356,57342,8205,55358,56605,8205,55357,56424,55356,57340],[55357,56424,55356,57342,8203,55358,56605,8203,55357,56424,55356,57340])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(n=t.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='openid-css' href='https://microformats.org/wordpress/wp-content/plugins/openid/f/openid.css?ver=519' type='text/css' media='all' /> <link rel='stylesheet' id='wp-block-library-css' href='https://microformats.org/wordpress/wp-includes/css/dist/block-library/style.min.css?ver=5.4.16' type='text/css' media='all' /> <link rel='stylesheet' id='microformatsorg-style-css' href='https://microformats.org/wordpress/wp-content/themes/microformats/style.css?ver=1.0' type='text/css' media='screen' /> <link rel='stylesheet' id='microformatsorg-print-style-css' href='https://microformats.org/wordpress/wp-content/themes/microformatscss/print.css?ver=1.0' type='text/css' media='print' /> <link rel='https://api.w.org/' href='https://microformats.org/wp-json/' /> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://microformats.org/wordpress/xmlrpc.php?rsd" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://microformats.org/wordpress/wp-includes/wlwmanifest.xml" /> <link rel='prev' title='Evolving for 12 Years' href='https://microformats.org/2017/06/20/evolving-for-12-years' /> <link rel='next' title='Happy 13th to microformats.org!' href='https://microformats.org/2018/06/21/happy-13th-to-microformats-org' /> <meta name="generator" content="WordPress 5.4.16" /> <link rel="canonical" href="https://microformats.org/2017/06/22/improving-the-php-mf2-parser" /> <link rel='shortlink' href='https://microformats.org/?p=469' /> <link rel="alternate" type="application/json+oembed" href="https://microformats.org/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fmicroformats.org%2F2017%2F06%2F22%2Fimproving-the-php-mf2-parser" /> <link rel="alternate" type="text/xml+oembed" href="https://microformats.org/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fmicroformats.org%2F2017%2F06%2F22%2Fimproving-the-php-mf2-parser&#038;format=xml" /> <link rel="icon" href="https://microformats.org/media/2020/06/microformats-logo-150x150.png" sizes="32x32" /> <link rel="icon" href="https://microformats.org/media/2020/06/microformats-logo.png" sizes="192x192" /> <link rel="apple-touch-icon" href="https://microformats.org/media/2020/06/microformats-logo.png" /> <meta name="msapplication-TileImage" content="https://microformats.org/media/2020/06/microformats-logo.png" /> </head> <body class="post-template-default single single-post postid-469 single-format-standard"> <div id="wrap"> <div id="header"> <h1> <a href="/"> <img src="https://microformats.org/wordpress/wp-content/themes/microformats/img/logo.gif" width="144" height="36" alt="microformats" /> </a> </h1> <nav id="nav"> <ul id="menu-main-navigation" class="primary-menu"><li id="menu-item-501" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-501"><a href="/blog">Blog</a></li> <li id="menu-item-511" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-511"><a href="/wiki">Wiki</a></li> <li id="menu-item-512" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-512"><a href="/wiki/irc">Discuss</a></li> <li id="menu-item-513" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-513"><a href="/wiki/about">About</a></li> <li id="menu-item-514" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-514"><a href="/wiki/code-tools">Code &#038; Tools</a></li> <li id="menu-item-515" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-515"><a href="/wiki/get-started">Get Started</a></li> </ul> </nav> </div> <hr class="hide" /> <div id="content"> <article id="post-469" class="entry single post-469 post type-post status-publish format-standard hentry category-news"> <h2 class="entry-title" id="post-469">Improving the php-mf2 parser</h2> <div class="entry-content"> <p>During the past year, the popular <a href="https://github.com/indieweb/php-mf2">php-mf2</a> microformats parser has received quite a few improvements. My site runs ProcessWire and one of the plugins for it uses php-mf2, so I have been spending some time on it.</p> <p>My own experience with microformats started when I discovered the <a href="http://microformats.org/wiki/hcard">hCard microformat</a>. I was impressed with the novelty of adding some simple HTML classes around contact information and having a browser extension parse it into an address book. Years later, when I started to get involved in the IndieWeb community, I learned a lot more about microformats2 and they became a key building block of my personal site.</p> <p>php-mf2 is now much better at backwards-compatible parsing of microformats1. This is important because software should be able to consistently consume content whether it’s marked up with microformats1, microformats2, or a combination. An experimental feature for parsing language attributes has also been added. Finally, it’s now using the microformats test suite. Several other parsers use this test suite as well. This will make it easier to catch bugs and improve all of the different parsers.</p> <p>php-mf2 is a stable library that’s ready to be installed in your software to start consuming microformats. It is currently used in <a href="https://withknown.com">Known</a>, <a href="https://wordpress.org/plugins/semantic-linkbacks/">WordPress plugins</a>, and <a href="https://modules.processwire.com/modules/webmention/">ProcessWire plugins</a> for richer social interactions. It’s also used in tools like <a href="https://github.com/aaronpk/XRay">XRay</a> and <a href="https://microformats.io">microformats.io</a>. I’m looking forward to more improvements to php-mf2 in the coming year as well as more software using it!</p> <p>Original published at: <a href="https://gregorlove.com/2017/06/improving-the-php-mf2-parser/" rel="canonical">https://gregorlove.com/2017/06/improving-the-php-mf2-parser/</a></p> </div> <ul class="post-info"> <li> <a class="updated" href="https://microformats.org/2017/06/22/improving-the-php-mf2-parser" rel="bookmark" title="Permanent Link to Improving the php-mf2 parser"> <span class="value-title" title="2017-06-22T09:13:53"> </span> Thursday, June 22nd, 2017 at 9:13 am </a> </li> <li> <address class="author vcard"> <a class="url fn" href="https://gregorlove.com/"> <img alt='' src='https://secure.gravatar.com/avatar/aca81ab5bf69a4626c91edc811cea208?s=16&#038;d=mm&#038;r=pg' srcset='https://secure.gravatar.com/avatar/aca81ab5bf69a4626c91edc811cea208?s=32&#038;d=mm&#038;r=pg 2x' class='avatar avatar-16 photo' height='16' width='16' /> gRegor Morrill </a> </address> </li> <li> </li> </ul> </article> <!-- You can start editing here. --> <!-- If comments are closed. --> <p class="nocomments">Comments are closed.</p> </div> <hr class="hide" /> <div id="sidebar"> <div id="recent-posts-2" class="box widget widget_recent_entries"><div class="box-inner"> <h3>Recent Posts</h3> <ul> <li> <a href="https://microformats.org/2022/02/19/how-to-consume-microformats-2-data">How to Consume Microformats 2 Data</a> </li> <li> <a href="https://microformats.org/2020/03/04/google-confirms-microformats-are-still-a-recommended-metadata-format-for-content">Google confirms Microformats are still a recommended metadata format for content</a> </li> <li> <a href="https://microformats.org/2018/06/22/microformats-org-year-14-welcome-new-admins">microformats.org Year 14 — Welcome New Admins</a> </li> <li> <a href="https://microformats.org/2018/06/21/happy-13th-to-microformats-org">Happy 13th to microformats.org!</a> </li> <li> <a href="https://microformats.org/2017/06/22/improving-the-php-mf2-parser" aria-current="page">Improving the php-mf2 parser</a> </li> <li> <a href="https://microformats.org/2017/06/20/evolving-for-12-years">Evolving for 12 Years</a> </li> <li> <a href="https://microformats.org/2016/06/22/microformats-org-at-11">microformats.org at 11</a> </li> <li> <a href="https://microformats.org/2014/06/20/microformats-org-turns-9-upgrade-to-microformats2">microformats.org turns 9 — upgrade to microformats2 and more</a> </li> <li> <a href="https://microformats.org/2014/03/05/getting-started-with-microformats2">Getting Started With microformats2</a> </li> <li> <a href="https://microformats.org/2012/06/25/microformats-org-at-7">microformats.org at 7</a> </li> </ul> </div></div><div id="categories-137139891" class="box widget widget_categories"><div class="box-inner"><h3>Post Categories</h3> <ul> <li class="cat-item cat-item-22"><a href="https://microformats.org/category/events" title="Events about or including microformats; parties, conferences and hack days.">Events</a> </li> <li class="cat-item cat-item-1"><a href="https://microformats.org/category/news">News</a> </li> <li class="cat-item cat-item-39"><a href="https://microformats.org/category/this-week" title="This Week in Microformats is a semi-regular update of what&#039;s happened on the microformats.org wiki and mailing lists.">This Week in Microformats</a> </li> </ul> </div></div> <div class="box"> <div class="box-inner"> <form method="get" id="search" action="/wordpress/index.php"> <div> <input type="text" value="search blog" name="s" id="search-text" onfocus="if(this.value=='' || this.value=='search blog'){this.value='';}" onblur="if(this.value==''){this.value='search blog';}" /> <input type="image" id="search-submit" alt="Search" src="https://microformats.org/wordpress/wp-content/themes/microformats/img/btn-search.gif" /> </div> </form> </div> </div> <div class="box"> <div class="box-inner"> </div> </div> </div> <!-- end #sidebar --> <hr class="hide" /> <div id="footer"> <p>Powered by <a href="http://wordpress.org">WordPress</a> | Hosting sponsored by <a href="https://www.linode.com/?r=f27e4bad029e8c2a2bf8737bf12439133dd4b977">Linode</a> | <a href="http://no-www.org/">No WWW</a>. </p> </div> </div> <!-- end #wrap --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript" /> <script type="text/javascript"> _uacct = "UA-1889385-1"; urchinTracker(); </script> <script type='text/javascript' src='https://microformats.org/wordpress/wp-includes/js/wp-embed.min.js?ver=5.4.16'></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10