Skip to main content

Ralsina.Me — Roberto Alsina's website

PyCamp Panorama

So you could­n't make it to Py­Cam­p? This is the place. Sor­ry, I can't post the awe­some, so it's just a pic­ture :-)

Get Adobe Flash player

Nikola-as-a-service demo

One of the things I hacked at dur­ing this Py­Camp is try­ing to fig­ure out a nice work­flow for Niko­la, some­thing that will en­able users that are not so tech­ni­cal, to use it.

One first step is Niko­la-as-a-ser­vice, which is meant for tech­ni­cal users any­way but lays down the in­fra­struc­ture for this to work semi-nice­ly.

In the video be­low, you will see me do this:

  • Go to GitHub

  • Take a starter's blog I pro­vid­ed, and do a clone

  • Go to the niko­la-as-a-ser­vice site, and lo­­gin (via twit­ter)

  • Cre­ate a site us­ing my fork's re­po URL

  • Get a "we­b­hook" URL, and add it to my fork's ad­min as a post-­­com­mit hook

  • Ed­it a file in github's web UI and com­mit it (y­ou can of course just push from any github clien­t)

  • Au­­to­­mat­i­­cal­­ly, the site niko­la-as-a-ser­vice pub­­lish­es gets up­­­dat­ed.

Please don't try to use this ser­vice yet be­cause:

  1. It's run­n­ing in a $4.50/­­month serv­er

  2. It's the same serv­er my own blog us­es

  3. I will turn it of­f, delete ev­ery­thing, etc. ev­ery once in a while

  4. I am ed­it­ing the code on the server, so no guar­an­­tees it will not just stop work­ing.

So, here's the video:

PyCamp 2012 - Day 3

So, day 3 and nex­t-­to-last of Py­Camp is done.

  • Great day, sun­ny, not all that cold

  • Em­­panadas at lunch, piz­za for din­n­er, cake for tea. Feel­ing kin­­da spoiled to­­day.

  • Lots of hack­­ing at Niko­la-as-a-ser­vice (de­­tails be­low)

  • PyAr meet­ing by a huge, some­what scary bon­­fire ear­li­er tonight

So: Niko­la-as-a-ser­vice is an idea where you can keep your blog some­where, and this ser­vice will get the data, and pub­lish a nice site for you.

Here's the cur­rent work­flow, which is just one of a dozen that can be im­ple­ment­ed be­cause this thing is quite sim­ple:

  1. The au­then­ti­­ca­­tor

    Cur­ren­t­­ly it has twit­ter au­then­ti­­ca­­tion. You nev­er need to cre­ate an ac­­coun­t, just lo­­gin with some ser­vice you al­ready have ac­­counts with. Any­thing with OAuth will work.

  2. The da­­ta provider

    Cur­ren­t­­ly, github. Soon, Ubun­­tu One. Lat­er, who knows. A da­­ta provider is some­thing from where we can grab data, and that can no­ti­­fy us (au­­to­­mat­i­­cal­­ly or by hav­ing the us­er click on a but­­ton) when we should get that da­­ta and re­build the site.

  3. The ren­der­er

    I am do­ing it with Niko­la, of course :-)

  4. The in­­fra­struc­­ture

    Jobs us­ing Re­dis and Cel­ery, serv­er app us­ing Flask, ren­der­ing us­ing Niko­la

  5. How does it work?

    You go to github, clone a bare­bones blog. Do your mod­­i­­fi­­ca­­tion­s. Go to niko­la-as-a-ser­vice, and lo­­gin via some­thing. Then you give Niko­la your github re­po's URL, and you get a we­b­hook URL. Go back to github, and con­­fig­ure the we­b­hook.

    From that mo­­ment on, ev­ery time you push to github, your blog is up­­­dat­ed :-)

    In the fu­­ture: ev­ery time you save to Ubun­­tu One, your blog is up­­­dat­ed. In the fur­ther fu­­ture: Ev­ery time you X to Y, your blog is up­­­dat­ed.

It's go­ing to be cool :-)

PyCamp 2012: Day 2

Fin­ish­ing Day 2, here's the up­date.

https://p.twimg.com/AxO0roICMAAfLJd.jpg

That is one large spi­der, dude.

  • Woke up 10 time be­­cause David Lit­­vak does­n't know how to turn off his alar­m. Now hat­ing "Good Day Sun­shine" by The Bea­t­les. Sor­ry Ringo!

  • Learned about Cel­ery/Flask/Jug­ger­­naut. To­­mor­row will try to hack on the Niko­la serv­er idea us­ing that. Hugo Rus­c­it­ti al­ready did a lot of work!

  • Helped Martín Gaitán do Niko­la gallery im­prove­­ments (look­ing much nicer now!)

  • Im­­ple­­men­t­ed code list­ings for Niko­la

  • Had a huge spi­der walk up my leg.

  • Had asa­­do for din­n­er!

  • Played with re­­mote con­trolled cars.

  • Saw a guy jug­­gle while rid­ing a mono­­cy­­cle

  • Played in the ping pong tour­­na­­ment (record 1-1, out in the group phase)

  • Fixed a bunch of bugs that popped while im­­ple­­men­t­ing stuff.

To­mor­row: will hack all day in the niko­la host­ing idea.

New Nikola Feature: code listings

This is a new fea­ture in Niko­la, my stat­ic web­site and blog gen­er­a­tor.

It's aimed at show­ing pieces of files in the post­s, and giv­ing you a link to the full file, does rea­son­able syn­tax high­light thanks to pyg­ments, and the syn­tax for em­bed­ding in your posts is not ex­ces­sive­ly aw­ful, so I can use it for some of my tu­to­ri­al / book project­s.

Here's an ex­am­ple:

.. listing:: md.py python
   :start-at: def compile_html
   :end-before: output =

Sys­tem Mes­sage: ER­ROR/3 (<string>, line 14)

Er­ror in "list­ing" di­rec­tive: un­known op­tion: "s­tart-at".

.. listing:: md.py python
    :start-at: def compile_html
    :end-before: output =

This is not merged in­to mas­ter yet, but should be soon.


Contents © 2000-2020 Roberto Alsina