View Single Post
Old 06-19-2014, 11:53 PM   #3005
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by JimmXinu View Post
Well, I still don't see the keywords. I wonder if it's a skin issue.
They aren't displayed. They are in the <head> section of the source as a attributes of a meta tag. Firefox will display this when you show the page info.
Quote:
But I found parsing the 'tags' to be very easy. Attached is a version that adds the site specific metadatum 'eroticatags' for literotica.com only.
That only works for a single page story. These tags are on the last page. See http://www.literotica.com/s/chandra as an example.

The full code I have is:
Code:
categories = soup.find("meta", {"name":"keywords"})['content'].split(', ')
categories = [c for c in categories if not self.story.getMetadata('title') in c]
if self.story.getMetadata('author') in categories:
    categories.remove(self.story.getMetadata('author'))
for category in categories:
    self.story.addToList('category', category.title())
That's a little bit clumsy and I should clean it up a bit.
davidfor is offline