List Info

Thread: Unable to get excerpt.py to work correctly




Unable to get excerpt.py to work correctly
user name
2007-05-27 12:15:16
Hello,

I am trying to use excerpt.py as a filter to display excerpts of each feed post that is aggregated on my site. However, it is not grabbing anything. Instead, each feed just has the heading and then '###' where the excerpt should be. This appears to be the default (without excerpt.py) behaviour, which indicates excerpt.py does not appear to be working correctly. However, when I run the update using planet.py, it appears that excerpt.py is being run against each site.

Here is the current site which uses Planet. 2.0: http://bcbloggers.com.

Here is the new test site using Venus and excerpt.py: http://bcbloggers.com/testindex.html

Here is an excerpt from the config.ini being used with the test site:

[Planet]
# name: Your planet';s name
# link: Link to the main page
# owner_name: Your name
# owner_email: Your e-mail address
name = BC Bloggers
link = http://bcbloggers.com
owner_name = Jeff Childs
owner_email = bcbloggers[at]gmail[dot]com

# cache_directory: Where cached feeds are stored
# new_feed_items: Number of items to take from new feeds
# log_level: One of DEBUG, INFO, WARNING, ERROR or CRITICAL
# feed_timeout: number of seconds to wait for any given feed
cache_directory = /var/www/html/venus/cache
new_feed_items = 1
log_level = DEBUG
feed_timeout = 20
spider_threads = 10
filters = excerpt.py

[excerpt.py]
omit = p br
width = 300


The current site has excerpts, but the posts do not have a consistent length, which is why I want to use excerpt.py. There are also other problems with Planet 2.0 that I'm hoping Venus will eliminate, at least in part. Can you offer any advice? Thanks.

Jeff
Re: Unable to get excerpt.py to work correctly
user name
2007-05-27 17:45:38
Hi,

When I was setting up my blog aggreagator to display excerpts at http://bloggers.pk I ran into the same problem only to realize later that a call must be made from the Index.html.tmpl file to pull the extracted excerpt into the main page and I went about by replacing the <TMPL_VAR content>;  with <TMPL_VAR excerpt>;.

That solved the issue, but there are some blogs which still don't display any content (about 20%) probably some tag that disables the excerpt entirely - in my planet.py I have these tags on ommision

omit = div br table script


Hope this helps

Awab
http://bloggers.pk

Webmaster wrote:
mail.gmail.com" type="cite">Hello,

I am trying to use excerpt.py as a filter to display excerpts of each feed post that is aggregated on my site. However, it is not grabbing anything. Instead, each feed just has the heading and then '###' where the excerpt should be. This appears to be the default (without excerpt.py) behaviour, which indicates excerpt.py does not appear to be working correctly. However, when I run the update using planet.py, it appears that excerpt.py is being run against each site.

Here is the current site which uses Planet. 2.0: http://bcbloggers.com.

Here is the new test site using Venus and excerpt.py: http://bcbloggers.com/testindex.html

Here is an excerpt from the config.ini being used with the test site:

[Planet]
# name: Your planet's name
# link: Link to the main page
# owner_name: Your name
# owner_email: Your e-mail address
name = BC Bloggers
link = http://bcbloggers.com
owner_name = Jeff Childs
owner_email = bcbloggers[at]gmail[dot]com

# cache_directory: Where cached feeds are stored
# new_feed_items: Number of items to take from new feeds
# log_level: One of DEBUG, INFO, WARNING, ERROR or CRITICAL
# feed_timeout: number of seconds to wait for any given feed
cache_directory = /var/www/html/venus/cache
new_feed_items = 1
log_level = DEBUG
feed_timeout = 20
spider_threads = 10
filters = excerpt.py

[excerpt.py]
omit = p br
width = 300


The current site has excerpts, but the posts do not have a consistent length, which is why I want to use excerpt.py. There are also other problems with Planet 2.0 that I'm hoping Venus will eliminate, at least in part. Can you offer any advice? Thanks.

Jeff
Re: Unable to get excerpt.py to work correctly
country flaguser name
United States
2007-05-28 19:00:51
Webmaster wrote:
> Hello,
> 
> I am trying to use excerpt.py as a filter to display
excerpts of each 
> feed post that is aggregated on my site. However, it is
not grabbing 
> anything. Instead, each feed just has the heading and
then '###' where 
> the excerpt should be. This appears to be the default
(without 
> excerpt.py) behaviour, which indicates excerpt.py does
not appear to be 
> working correctly. However, when I run the update using
planet.py, it 
> appears that excerpt.py is being run against each
site.
> 
> Here is the current site which uses Planet. 2.0: http://bcbloggers.com.
> 
> Here is the new test site using Venus and excerpt.py: 
> http://bcblogger
s.com/testindex.html

What does your template look like?

- Sam Ruby
-- 
devel mailing list
devellists.planetplanet.org

http://lists.planetplanet.org/mailman/listinfo/devel

Re: Unable to get excerpt.py to work correctly
user name
2007-05-28 23:24:45
Sam,

Here is the entry loop portion of the template. Let me know if you need more detail/information.

Thanks,

Jeff


<TMPL_LOOP Items>
<TMPL_IF new_date&gt;
<TMPL_UNLESS __FIRST__&gt;
### End <div class=&quot;channelgroup"&gt;
</div>
### End <div class=&quot;daygroup&quot;>
&lt;/div>
</TMPL_UNLESS>
<div class=&quot;daygroup&quot;>
&lt;h2>&lt;TMPL_VAR new_date&gt;</h2&gt;
</TMPL_IF>

<TMPL_IF new_channel>
<TMPL_UNLESS new_date&gt;
### End <div class=&quot;channelgroup"&gt;
</div>
</TMPL_UNLESS&gt;
<div class=&quot;channelgroup"&gt;

### Planet provides template variables for *all* configuration options for
### the channel (and defaults), even if it doesn't know about them. ; We
### exploit this here to add hackergotchi faces to our channels.&nbsp; Planet
### doesn't know about the "face", "facewidth" and "faceheight"; configuration
### variables, but makes them available to us anyway.

&lt;h3>&lt;a href=&quot;<TMPL_VAR channel_link ESCAPE=&quot;HTML&quot;>"; title=&quot;<TMPL_VAR channel_title_plain ESCAPE=&quot;HTML&quot;>";><TMPL_VAR channel_name&gt;</a>; &nbsp; &nbsp; &nbsp; (<TMPL_VAR channel_location>)</h3>
<TMPL_IF channel_face>
<img class=&quot;face"; src=&quot;images/&lt;TMPL_VAR channel_face ESCAPE=&quot;HTML&quot;>"; width=&quot;<TMPL_VAR channel_facewidth ESCAPE=&quot;HTML&quot;>"; height=&quot;<TMPL_VAR channel_faceheight ESCAPE=&quot;HTML&quot;>"; alt="">
</TMPL_IF>
<;/TMPL_IF&gt;


<div class=&quot;entrygroup" id="&lt;TMPL_VAR id>&quot;<TMPL_IF channel_language&gt; lang=";<TMPL_VAR channel_language&gt;"<;/TMPL_IF&gt;>
&lt;TMPL_IF title>
<h4<TMPL_IF title_language> lang="&lt;TMPL_VAR title_language>&quot;</TMPL_IF>>;<a href="<;TMPL_VAR link ESCAPE=&quot;HTML&quot;>";><TMPL_VAR title></a></h4>
<;/TMPL_IF&gt;
<div class=&quot;entry&quot;>
<div class=&quot;content&quot;<TMPL_IF content_language> lang=";<TMPL_VAR content_language>&quot;</TMPL_IF>&gt;
<TMPL_VAR summary>;
</div>

###
### Changed TMPL_VAR content to TMPL_VAR summary
### Planet also makes available all of the information from the feed
### that it can.  Use the 'planet-cache'; tool on the cache file for
### a particular feed to find out what additional keys it supports.
### Comment extra fields are 'author' and 'category' which we
### demonstrate below.

&lt;p class=&quot;date";>
&lt;a href=";<TMPL_VAR link ESCAPE=&quot;HTML&quot;>";><TMPL_IF author>by <TMPL_VAR author> at
</TMPL_IF>&lt;TMPL_VAR date>&lt;TMPL_IF category&gt; under <TMPL_VAR category&gt;</TMPL_IF></a>
&lt;/p>
&lt;/div>
</div>;

<TMPL_IF __LAST__&gt;
### End <div class=&quot;channelgroup"&gt;
</div>
### End <div class=&quot;daygroup&quot;>
&lt;/div>
</TMPL_IF>
&lt;/TMPL_LOOP>

On 5/28/07, Sam Ruby < rubysintertwingly.net">rubysintertwingly.net> wrote:
Webmaster wrote:
>; Hello,
>;
> I am trying to use excerpt.py as a filter to display excerpts of each
> feed post that is aggregated on my site. However, it is not grabbing
&gt; anything. Instead, each feed just has the heading and then '###&#39; where
&gt; the excerpt should be. This appears to be the default (without
&gt; excerpt.py) behaviour, which indicates excerpt.py does not appear to be
> working correctly. However, when I run the update using planet.py , it
> appears that excerpt.py is being run against each site.
>
> Here is the current site which uses Planet. 2.0: http://bcbloggers.com.
>
>; Here is the new test site using Venus and excerpt.py:
> http://bcbloggers.com/testindex.html

What does your template look like?

- Sam Ruby

Re: Unable to get excerpt.py to work correctly
country flaguser name
United States
2007-05-29 08:46:45
Jeff Childs wrote:
> Sam,
> 
> Here is the entry loop portion of the template. Let me
know if you need 
> more detail/information.
> 
> Thanks,
> 
> Jeff
> 
> <div class="content"<TMPL_IF
content_language> lang="<TMPL_VAR 
> content_language>"</TMPL_IF>>
> <TMPL_VAR summary>
> </div>
> 
> ###

Now lets comparing that to the output produced:

> <div class="entry">
> <div class="content"
lang="en">
> </div>
> 
> ###

First, there seems to be a simple explanation for the three
hash marks 
appearing in the output.  Delete that line, and see if it
helps.

As to the missing summary, there are two parts to that. 
First, 
excerpt.py doesn't produce a summary, it produces a
planet:excerpt. 
That element isn't available to htmltmpl style templates.  I
can fix 
that part.

But a deeper mystery remains: why isn't the original summary
showing up? 
  Nothing, not even a blank line, appears in the output. 
I'm stumped on 
that.

In any case, as to the part I can fix, I have pushed out an
update to 
excerpt.py to accept a 'target' parameter allowing you to
specify the 
name of the target element.  The default remains
'planet:excerpt', but 
you can specify 'atom:summary' or even simply 'summary' if
you like.  An 
example usage can be found at:

http://intertwingly.net/code/venus/t
ests/data/filter/excerpt-lorem-ipsum.ini

- Sam Ruby



-- 
devel mailing list
devellists.planetplanet.org

http://lists.planetplanet.org/mailman/listinfo/devel

Re: Unable to get excerpt.py to work correctly
user name
2007-05-31 16:02:13
I downloaded the latest excerpt.py and put it into place. I re-ran planet.py against the config.ini, and tried it several times using ; just the defaults and also trying target = atom:summary, and target = summary.

Still the same result, no portion of the excerpt is appearing. Any other ideas? I would really like to get Venus into place to replace Planet 2.0, but I need to have excerpts of the posts.

Thanks,

Jeff

On 5/29/07, Sam Ruby < rubysintertwingly.net">rubysintertwingly.net &gt; wrote:
Jeff Childs wrote:
>; Sam,
>
> Here is the entry loop portion of the template. Let me know if you need
>; more detail/information.
&gt;
> Thanks,
&gt;
> Jeff
>
> <div class=&quot;content&quot;<TMPL_IF content_language> lang=";<TMPL_VAR
> content_language>&quot;</TMPL_IF>&gt;
> <TMPL_VAR summary>;
> </div&gt;
>
>; ###

Now lets comparing that to the output produced:

> <div class=&quot;entry&quot;>
> <div class=&quot;content&quot; lang=";en"&gt;
> </div&gt;
>
>; ###

First, there seems to be a simple explanation for the three hash marks
appearing in the output.&nbsp; Delete that line, and see if it helps.

As to the missing summary, there are two parts to that. ; First,
excerpt.py doesn't produce a summary, it produces a planet:excerpt.
That element isn't available to htmltmpl style templates.  ;I can fix
that part.

But a deeper mystery remains: why isn't the original summary showing up?
&nbsp; Nothing, not even a blank line, appears in the output.&nbsp; I&#39;m stumped on
that.

In any case, as to the part I can fix, I have pushed out an update to
excerpt.py to accept a 'target' parameter allowing you to specify the
name of the target element.&nbsp; The default remains 'planet:excerpt&#39;, but
you can specify 'atom:summary'; or even simply 'summary' if you like. ; An
example usage can be found at:

http://intertwingly.net/code/venus/tests/data/filter/excerpt-lorem-ipsum.ini

- Sam Ruby




[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )