patch to extract license data
Sam Ruby
rubys at intertwingly.net
Mon Nov 12 05:22:18 EST 2007
Nathan Kinkade wrote:
> 2007/11/10, Sam Ruby <rubys at intertwingly.net>:
>> Asheesh Laroia wrote:
>>> On Wed, 7 Nov 2007, Nathan Kinkade wrote:
>>>
>>>> I've put together a small patch that will extract license data from
>>>> feeds and then make that data available to the templates.
>>> Hey, planet folks - any comments on this patch? It's been a few days
>>> with no response, so I figured I'd reping the list on N. Kinkade's behalf.
>>>
>>> It's pretty simple; I'm attaching it in case that's a preferred format.
>>> Do let us at CC know if it needs some changes or improvement.
>>>
>>> It takes advantage of feedparser's license extraction from feeds and
>>> lets you display that data in the template.
>> I'm not sure why I never saw the original post, but I do have a few
>> comments:
>>
>> Per contributing[1], I would like to see some documentation, and a test.
>> That could be as simple as a single file in tests/data/filter/tmpl
>> [2], and a table row in docs/templates.html [3].
>>
>> I'd gladly include a new theme that shows off cc, but I would rather the
>> classic fancy theme itself be left unchanged.
>>
>> Finally, I'd rather that the fetching and styling of the license
>> information be moved into a plugin, and not placed inside the venus code
>> itself. Ideally, the fetching would cache the results, but if it is in
>> an optional plugin, I'm not overly concerned. You can look at
>> mememe.plugin[4] for examples on how to do all this.
>>
>> - Sam Ruby
>>
>> [1] http://intertwingly.net/code/venus/docs/contributing.html
>> [2] http://intertwingly.net/code/venus/tests/data/filter/tmpl/
>> [3] http://intertwingly.net/code/venus/docs/templates.html
>> [4] http://intertwingly.net/code/venus/filters/mememe.plugin
>
> I don't think the original email ever made it to the list. It was
> (is?) stuck waiting for moderator approval, at least that's what an
> email I received told me, but I'm subscribed to the list now.
>
> I'll be happy to move the changes into a plugin, and I'll take a look
> at the mememe.plugin example you gave.
>
> Sorry about the lack of documentation. Submitting these changes back
> to Venus was an after-thought (given to me by Asheesh), so I hadn't
> given much thought to formal documentation, outside of comments inline
> with my changes.
Code extracted from something used to scratch one's own itches is
generally the best kind. :-)
> As far as changes to the templates and/or showcasing a special CC
> template, I believe our custom template is most likely way too CC
> specific to be of much use to anyone else.
> http://planet.creativecommons.org, rather mimics the main
> http://creativecommons.org site. But maybe I'm wrong about the
> utility of that theme. I only made the change to classic_fancy theme
> as a simple demonstration of how to insert the license data, which is
> really nothing more than putting <TMPL_VAR license> wherever one
> wants, provided it's inside of the an "Items" loop. I had initially
> been putting the license data in the "Channels" list as well, but
> later took it out, deeming it unnecessary.
Overall, it probably is simple enough not to need an example.
> Let me take a look at moving the small amount of code out of Venus and
> into a plugin, caching CC license name lookups to a local file, and
> also putting together a little more documentation.
Just to be clear: exposing the 'license' information to htmltmpl is a
reasonable addition to venus itself. It is the specific styling and
additional fetching of creative commons specific information that should
be an option. Note: I'm less of a stickler for test cases on plugins.
Now, if caching is in place, the plugin could efficiently implement the
full Licensed Content Discovery algorithm described on this page:
http://wiki.creativecommons.org/Syndication
Meanwhile, I'm test drive a subtle change to the template that I use
(themes/asf) so that the rights and license information present in the
feed is visible. At the bottom of every post is the author information.
When this information is present, the simple word "by" will be
replaced by the © character, and it will be associated with a hypertext
link to the license and/or a mouseover text with the rights information.
You can see an example of the result here:
http://planet.intertwingly.net/
Any advice you might have on best practices for displaying this
information is welcome.
> Thanks,
>
> Nathan
- Sam Ruby
More information about the devel
mailing list