News for hackers. Stuff that matters.
Re:Simple - An Obtvse clone written in Python by jsherer on Wednesday March 28, 2012 @11:37AM (#3766755)
I'd like to see one of these clones that more closely resembles the static site generators like Jekyll (http://jekyllrb.com/) or Hyde (http://ringce.com/hyde). Basically, the CMS would just be the interface to create new and manage existing content. It would have the standard static publish function that builds out the pages of the blog as HTML.

(NOTE: "Simple" is not my project)

Re:Simple - An Obtvse clone written in Python by espeed on Wednesday March 28, 2012 @12:59PM (#3767199)
Lightbulb (https://github.com/espeed/lightbulb) is a Git-powered, Neo4j-backed blog engine written in Python.

It allows you to create entries in ReStruturedText using a text editor. I designed it with Heroku in mind, but can be easily adapted for any Web environment that uses Git.

When you push to Heroku, the entry metadata will be automatically saved to Neo4j, and the HTML fragment generated from the ReStructuredText source file will be served off disk.

You can use the free Heroku dyno and Neo4j Add-on (https://addons.heroku.com/neo4j) to serve your blog for free.

Re:Simple - An Obtvse clone written in Python by kisielk on Wednesday March 28, 2012 @01:55PM (#3767479)
What's the advantage of storing a blog in a graph database? Or is it just one of those "just because I could" things?
Re:Simple - An Obtvse clone written in Python by espeed on Wednesday March 28, 2012 @02:18PM (#3767585)
Hi Kamil - A database-backed blog enables you to easily integrate the content into your existing website -- for example, dynamically displaying the latest entry on the home page, and it makes it easy to style the blog with the site's existing templating system rather than maintaining a separate system.

I wanted the benefits of a dynamic app, but I wasn't willing to exchange Emacs for a Web-based editor so I created a hybrid engine.

I chose Neo4j because graphs are an elegant way of storing relational data. There are no tables to mess with and no joins (everything is explicitly joined). And if your blog's auth/commenting system uses data from the social graph, such as Facebook or Twitter, a graph database provides a clean way of storing the data.

Also, I am the author of Bulbs (https://github.com/espeed/bulbs), a graph-database framework written in Python, so using it was a natural choice.

Re:Simple - An Obtvse clone written in Python by rglullis on Wednesday March 28, 2012 @04:40PM (#3768223)
> I chose Neo4j because graphs are an elegant way of storing relational data.

As opposed to, say, a Relational DBMS?

What you've done might be very interesting and rewarding to you, but it feels like you wasted three paragraphs in your response with something that falls right into the "just because I could" camp.

Re:Simple - An Obtvse clone written in Python by mgkimsal on Wednesday March 28, 2012 @05:09PM (#3768352)
Another way to read it: Relational databases just aren't elegant.
Re:Simple - An Obtvse clone written in Python by fusiongyro on Wednesday March 28, 2012 @06:29PM (#3768691)
"Elegance" is one of those empty words that's great for polarizing a debate without really adding any meaningful information.

Neo4j is neat and underutilized. I think rglullis is just saying, if that's why espeed used it, he could have saved three paragraphs of explanation by just saying that.

Re:Simple - An Obtvse clone written in Python by espeed on Wednesday March 28, 2012 @07:25PM (#3768859)
Notice I didn't just say it was elegant, I said why: "There are no tables to mess with and no joins (everything is explicitly joined)."

I find elegance in simplicity. If you don't need the tabular features of a relational database, why not use a graph DB for relational data? It's like a key value store with directly connected relationships.

This is so much simpler than having to deal with creating tables, DDLs, and migrations:

  >>> g = Graph()
  >>> james = g.vertices.create(name="James")
  >>> julie = g.vertices.create(name="Julie")
  >>> g.edges.create(james, "knows", julie)
Futhermore, there's no impedance mismatch so your code is cleaner.

But regardless, this is Hacker News where people explore, build, and share new things. I hope we're not moving to a place where that gets admonished.

Re:Simple - An Obtvse clone written in Python by kisielk on Wednesday March 28, 2012 @08:19PM (#3769020)
I've actually looked a bit at bulbflow before, being a Python programmer who has had an interest in graph databases for quite some time. That's why I asked my question originally. Can you give an example of the types of relations you're using the DB to represent in a blog?
Re:Simple - An Obtvse clone written in Python by espeed on Wednesday March 28, 2012 @09:19PM (#3769197)
These are the base elements:

  * Nodes/Vertices: Person, Topic, Entry
  * Relationships/Edges: Tagged, Authored

  person -- authored --> entry
  entry -- tagged --> topic
Here's the base model: https://github.com/espeed/lightbulb/blob/master/lightbulb/mo...

The comment system is a separate, generic component.

Marko, the guy who created Gremlin (https://github.com/tinkerpop/gremlin/wiki), just released a Gremlin Tree step (https://github.com/tinkerpop/gremlin/wiki/Tree-Pattern), which makes it really easy to build a threaded comment tree in one quick shot.

If you have a large blog or content system, you can use likes and views to make content recommendations using a basic Gremlin collaborative filtering query:

  // calculate basic collaborative filtering for vertex with user_id
  def rank_items(user_id) {
      m = [:]
      g.v(user_id).out('likes').in('likes').out('likes').groupCount(m)
      m.sort{a,b -> a.value <=> b.value}
      return m.values()
  }
If you use Facebook, Twitter, or GitHub to authenticate users you can easily incorporate friends and followers into the recommendations.
Re:Simple - An Obtvse clone written in Python by kisielk on Thursday March 29, 2012 @02:41PM (#3772457)
Thanks for taking the time to explain, I'll definitely be doing some reading over the code.
Re:Simple - An Obtvse clone written in Python by fusiongyro on Wednesday March 28, 2012 @10:54PM (#3769428)
I was really responding to mgkimsal, who brought up elegance. I'm all for experimentation, I am not for technical debates short on technical content. Please continue.
Re:Simple - An Obtvse clone written in Python by bravura on Wednesday March 28, 2012 @10:37PM (#3769391)
I want to bake NLP into an existing CMS, so let me speak to your point. To extend your idea, these tools should be much more modular:

Simple/Obtvse should be an interface for adding posts and editing existing posts. Similarly, a command-line-interface can also be used for adding posts. (`newidea "I want a castle made of marshmellows"`)

The site is stored in a database when live, but the database can be transformed one-to-one into a directory of human-readable Markdown or ReStructuredText files.

Rendering is handled by a separate component, e.g. nanoc or jekyll. The important thing is that the site database can easily be mapped to a human readable format. The advantage of this approach is that it is easy to write a modular rendering engine without mucking with the specifics of the CMS.

For example, I want to automagically categorize posts in a taxonomy, find related posts, group posts that are lists, etc. using some NLP wizardry. I would much rather write this application for a directory of human-readable files, adding metadata fields to text files, than paint myself into a corner with a particular CMS.

Please email me if you are interested.

Re:Simple - An Obtvse clone written in Python by X-Istence on Wednesday March 28, 2012 @01:48PM (#3767447)
I use one called Blogofile[1], but it is entirely local. You basically give it the posts as markdown/restructured text and it generates the entire site as static HTML. I'm sure you could use it as a starting point to start the service you just mentioned, instead of having it read the posts from disk have it read them from a database.

The thing I like about static generators is that I don't have to worry about a programming language being present on my hosting site (http://funcptr.net is blogofile, http://bertjwregeer.com/ is Poole.py[2]) and the overhead is a lot smaller, since all I have is static files there is a lot less worry about accidentally causing CPU spikes, or a database being overloaded, and using sendfile() one can very quickly and efficiently serve up HTML files to clients.

[1]: http://www.blogofile.com/ [2]: https://bitbucket.org/obensonne/poole/overview

Re:Simple - An Obtvse clone written in Python by marban on Monday April 02, 2012 @05:01AM (#3787047)
i've ported poole to python 3 just recently https://github.com/marban/Poole
Re:Simple - An Obtvse clone written in Python by hyperturtle on Wednesday March 28, 2012 @01:31PM (#3767365)
I'm making something like that at http://wr173.com/
Re:Simple - An Obtvse clone written in Python by drewinglis on Wednesday March 28, 2012 @06:12PM (#3768635)
I did a quick and dirty port of obtvse to jekyll last weekend. It still needs some work, though. It's here: https://github.com/drewinglis/obtvse-jekyll
Re:Simple - An Obtvse clone written in Python by ericmoritz on Wednesday March 28, 2012 @06:55PM (#3768774)
I use Pelican for my blog. It's pretty straight forward. http://readthedocs.org/docs/pelican/en/2.8/
Re:Simple - An Obtvse clone written in Python by anthonyb on Wednesday March 28, 2012 @10:57PM (#3769430)
What's wrong with just

  wget -m -k -nH <your URL here>
combined with some sort of rsync?
Re:Simple - An Obtvse clone written in Python by siong1987 on Wednesday March 28, 2012 @12:27PM (#3767023)
Then, it is not going to be as static as as static site generators like Jekyll or Hype. One good thing about those sites are that you don't have to serve those static sites from any hosting without any dynamic generation of the web pages.

But, with the feature you request, then, it doesn't really work for a static site generator. It is better to use normal caching with a dynamic site like how Simple is doing now.

Re:Simple - An Obtvse clone written in Python by corin_ on Wednesday March 28, 2012 @12:42PM (#3767098)
I don't think you follow what he is asking for. Jekyll uses CLI-based software to output raw HTML files that can be served to website visitors. Why not create a database (or flat-file) driven CMS, with nice features (e.g. wysiwyg) that then outputs raw HTML files?

So basically just a UI for writing and managing the posts that sits on top of Jekyll.

Re:Simple - An Obtvse clone written in Python by fusiongyro on Wednesday March 28, 2012 @01:16PM (#3767287)
It's funny, because this is what Movable Type did, back in the day. James Hague echoed your sentiments in "Solving the Wrong Problem": http://prog21.dadgum.com/130.html
Re:Simple - An Obtvse clone written in Python by jsherer on Wednesday March 28, 2012 @01:23PM (#3767328)
Exactly. Give me lean and lightweight MovableType with a sprinkling of Simple/Obtvse/Svbtle. Easy (or no?) install. Nice UI. Simple export to HTML.
Re:Simple - An Obtvse clone written in Python by alabut on Wednesday March 28, 2012 @06:59PM (#3768787)
Blogger was like that too and I loved it. It's why I've had super basic shared hosting at Dreamhost for so long - it could handle pretty much any traffic by serving up plain HTML.

I'd be curious to see how a "Blogger of today" would fare if it also had Dropbox integration, so you could use specialized local apps like IA Writer if you wanted to but also still write or edit on the go without your main machine.

Re:Simple - An Obtvse clone written in Python by siong1987 on Wednesday March 28, 2012 @06:56PM (#3768777)
Yes. That is what most caching feature does. Take Ruby on Rails as example, if you have a static page, you can just cache it as just raw HTML file(after the first rendering).
Re:Simple - An Obtvse clone written in Python by jamesgeck0 on Friday March 30, 2012 @12:50PM (#3776867)
That's what caching does, but it's not exactly the same use case. Jekyll just generates a folder full of static HTML files that I shoot out to a dumb server that doesn't run Ruby. I'd like continue to do this, and just run a shiny interface locally.

To do the same thing with the cache in a Rails app, I'd probably have to make a script to visit every page to get it to render to the cache, then copy the cache out. At that point, it'd probably be easier to ignore Rails' built-in caching and just to make a rake task that renders everything.

Re:Simple - An Obtvse clone written in Python by SpiderX on Wednesday March 28, 2012 @07:50PM (#3768938)
If you want a raw HTML file, what's stopping you from using CURL to get your raw HTML file and uploading it?