{"id":55,"date":"2007-09-16T23:31:20","date_gmt":"2007-09-16T18:01:20","guid":{"rendered":"http:\/\/www.bin-co.com\/blog\/2007\/09\/seinfeld-calendar-simple-way-to-force-yourself-to-create-content-regularly\/"},"modified":"2007-09-16T23:31:20","modified_gmt":"2007-09-16T18:01:20","slug":"seinfeld-calendar-simple-way-to-force-yourself-to-create-content-regularly","status":"publish","type":"post","link":"https:\/\/www.bin-co.com\/blog\/2007\/09\/seinfeld-calendar-simple-way-to-force-yourself-to-create-content-regularly\/","title":{"rendered":"Seinfeld Calendar &#8211; Simple way to Force Yourself to Create Content Regularly"},"content":{"rendered":"<p><a href='http:\/\/www.binnyva.com\/'><img class=\"intro\" align=\"right\" src='http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2007\/09\/binnyva.png' alt='BinnyVA.com' \/><\/a><\/p>\n<p class=\"intro\">I created an RSS aggregater for my site <strong class=\"highlight\"><a href=\"http:\/\/www.binnyva.com\/\">BinnyVA.com<\/a> that aggregates the content from all my sites<\/strong>. The basic idea is to build a <a href=\"http:\/\/lifehacker.com\/software\/motivation\/jerry-seinfelds-productivity-secret-281626.php\">Seinfeld Calendar<\/a> that will <a href=\"http:\/\/blog.binnyva.com\/2007\/09\/binnyvacom-my-seinfeld-calendar\/\">force me to continually publish<\/a> posts &#8211; at least 1 per day.<\/p>\n<p>It is very simple to create &#8211; whole system is contained in the following files&#8230;<\/p>\n<h3>fetcher.php<\/h3>\n<p>This will <strong class=\"highlight\">run once a day as a cron<\/strong> job. It <strong class=\"highlight\">downloads the feeds for all my sites, parses the XML and inserts the new posts into the database<\/strong>.<\/p>\n<p>The download is done by my <a href=\"http:\/\/www.bin-co.com\/php\/scripts\/load\/\">load PHP function<\/a>. It uses the curl library.<\/p>\n<p>The XML parsing uses the <a href=\"http:\/\/www.bin-co.com\/php\/scripts\/xml2array\/\">xml2array() PHP function<\/a>. Currently I parse only the RSS format &#8211; I am completely ignoring the atom format.<\/p>\n<p>Finally the data is inserted into the database &#8211; the following data is stored&#8230;<\/p>\n<ul>\n<li>Title<\/li>\n<li>Link<\/li>\n<li>Date<\/li>\n<li>Summary<\/li>\n<li>Full Content<\/li>\n<li>Categories\/Tags<\/li>\n<\/ul>\n<p>The full file is around 100 lines long.<\/p>\n<h3>index.php<\/h3>\n<p>This is a simple <strong class=\"highlight\">calendar scripts that lists all the posts of each days of one month<\/strong>. Includes a navigation to enable the visitor to go to the past months as well.<\/p>\n<h3>Other Files<\/h3>\n<p>There is a bit of <a href=\"http:\/\/binnyva.blogspot.com\/2006\/07\/practical-uses-for-modrewrite.html\">mod_rewrite<\/a> code that make sure that the URL are very clean. For example, the URL for April 2007 is <a href=\"http:\/\/www.binnyva.com\/2007\/04\/\">http:\/\/www.binnyva.com\/2007\/04\/<\/a>.<\/p>\n<p>The mod_rewrite for this is in the .htaccess file&#8230;<\/p>\n<pre><code><IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^([0-9]+)\/([0-9]+) index.php?year=$1&month=$2\n<\/IfModule>\n<\/code><\/pre>\n<h2>Don&#8217;t Break the Chain<\/h2>\n<p>Now all you have to do is <strong class=\"highlight\">make sure that each day has at least one post<\/strong> in it. This system had me creating content continually for the last two months.<\/p>\n<p>If you are looking for an easier way to create the calendar, try out <a href=\"http:\/\/dontbreakthechain.com\/\">Don&#8217;t break the chain<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>I created an RSS aggregater for my site BinnyVA.com that aggregates the content from all my sites. The basic idea is to build a Seinfeld <a class=\"mh-excerpt-more\" href=\"https:\/\/www.bin-co.com\/blog\/2007\/09\/seinfeld-calendar-simple-way-to-force-yourself-to-create-content-regularly\/\" title=\"Seinfeld Calendar &#8211; Simple way to Force Yourself to Create Content Regularly\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,21,30],"tags":[38,42,61,65,112,241],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-personal","category-php","category-web-development","tag-aggregate","tag-announce","tag-binnyvacom","tag-blogs","tag-feed","tag-rss"],"_links":{"self":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":0,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}