New plugin to get a 'Random' post

I created a new plugin to get a 'Random' post when hitting /random/ url.
The tag cloud json file seems to be completely broken. That needs a fix.
I'll handle this later.

-- 
Chris Warrick <https://chriswarrick.com/>
Sent from my Galaxy S3.
On Nov 24, 2014 10:03 PM, "Manuel Kaufmann" <notifications@github.com>
wrote:

> In v6/random_post/random_post.py:
>
> > +            'random/index.html'
> > +        )
> > +
> > +        # Yield a task for Doit
> > +        yield {
> > +            'basename': 'random_post',
> > +            'targets': (output_filename, output_index),
> > +            'actions': [
> > +                (create_json, (output_filename, urls)),
> > +                (create_index, (output_index, )),
> > +            ],
> > +            'uptodate': [utils.config_changed(kw)],
> > +        }
> > +
> > +
> > +def create_json(output, urls):
>
> Got it! Anyway, I'm not sure that this is useful for me. This is a chunk
> of that file generated by Nikola:
>
> ...
> u'zeitgeist': [4,
>   u'/categories/zeitgeist/',
>   {u'posts': [{u'date': u'03/16/2014',
>      u'isodate': u'2014-03-16T22:57:40-03:00',
>      u'title': u'Z-Day',
>      u'url': u'/posts/nikola/z-day.html'},
>     {u'date': u'09/17/2013',
>      u'isodate': u'2013-09-17T12:01:08-03:00',
>      u'title': u'Todo es un remix',
>      u'url': u'/posts/nikola/todo-es-un-remix.html'},
>     {u'date': u'09/14/2013',
>      u'isodate': u'2013-09-14T20:51:54-03:00',
>      u'title': u'Krishnamurti, mi maestro',
>      u'url': u'/posts/nikola/krishnamurti-mi-maestro.html'},
>     {u'date': u'09/13/2013',
>      u'isodate': u'2013-09-13T14:11:29-03:00',
>      u'title': u'Econom\xeda basada en recursos',
>      u'url': u'/posts/nikola/economia-basada-en-recursos.html'}]}]}
>
> The url attribute is not the same as my json generated file (
> /posts/economia-basada-en-recursos/). I don't know why, but it contains
> the ".html" at the final and also says it's under "posts/nikola" (it's true
> in the directory tree but not in the URL)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/getnikola/plugins/pull/62/files#r20821883>.
>