Re: Magic Word / trackback plugin
shunuhs <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, thank you for response and ccing steven and nathan.
My previous mail is related for not only trackback/magicword but also
trackback/all plugins for comment spam,include check_javscript plugin.
I heard that the check_javascript plugin reject trackback, too.
I think that there are two idea.
1. modify trackback/all plugins for comment spam
This idea is in my previous mail, it must apply the following code,
for example, to all comment spam plugins.
+ comment = args['comment']
+ if comment.get('comment_type') == 'trackback':
+ return False
> on second thought, this is an interesting idea. however, i suspect the spec
> already provides an official way to identify trackback pings:
>
>http://www.sixapart.com/pronet/docs/trackback_spec
>
>if you're still interested in contributing this fix upstream, would you mind
> looking at the spec to find the "right" way to identify trackbacks?
I think, the spec is specified for communication between server and client,
but cdit is just a internal data of the trackback/comments plugin, I think
we can add some new value.
cdict = { 'title': form.getvalue('title', ''), \
'author': 'Trackback from %s' % form.getvalue('blog_name', ''), \
'pubDate' : str(time.time()), \
'link' : form['url'].value, \
'source' : form.getvalue('blog_name', ''), \
'description' : form.getvalue('excerpt', '') }
But I think the following is adhoc as you say, too.
- 'description' : form.getvalue('excerpt', '') }
+ 'description' : form.getvalue('excerpt', ''), \
+ 'comment_type' : 'trackback' }
In the cdict of the comments plugin, 'source' value is None.
cdict = {'title': form['title'].value, \
'author' : form['author'].value, \
'pubDate' : str(time.time()), \
'link' : escape_link(url), \
'source' : '', \
'description' : add_dont_follow(body, config) }
So we can judge when 'source' has some value, this is trackback data,
and when 'source' is None, this is comment data.
Uhmm, blog_name is optional..., if blog_name is not included,
we can't judge whether comment or trackback data, we need another idea.
2. modify trackback/comments plugins
# This idea is from Junji who send patch for trackback plugin recently.
# He will send his patch hopefully :-)
This problem was occurs for both trackback and comments plugins use
writeComments() in the comments plugin and have judged whether the data
is rejected.
Then, the judgement code for comment reject move out of writeComments(),
and add judgement for trackback reject to trackback plugin.
2006/12/20, Ryan Barrett <pyblosxom-6sb6M7qyT/[email protected]>:
> On Tue, 19 Dec 2006, shunuhs wrote:
>
> > I think, in trackback plugin, when cdict dictionary have the data
> > indicate trackback, other plugin can check which comment or trackback
> > data safely, such a following code.
> ...
> > - 'description' : form.getvalue('excerpt', '') }
> > + 'description' : form.getvalue('excerpt', ''), \
> > + 'comment_type' : 'trackback' }
>
> on second thought, this is an interesting idea. however, i suspect the spec
> already provides an official way to identify trackback pings:
>
> http://www.sixapart.com/pronet/docs/trackback_spec
>
> if you're still interested in contributing this fix upstream, would you mind
> looking at the spec to find the "right" way to identify trackbacks?
>
> -Ryan
>
> --
> http://snarfed.org/
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV