Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Plugin: ajw_technorati_tags
> setar wrote:
> Has anyone implemented a nice form or CSS tag to present those tags? Trying to make them unobtrusive while keeping them next to the articles. Next to the comment invitation and they blend in, right next to the headline and they look way too important.
I’ve yet to play with those, but I would put them together with other meta information about your article (published/posted by, date, etc.). I might use a little background image as an icon, or use the ::after pseudo-element to give a special look. Maybe a different touch of colour.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: Plugin: ajw_technorati_tags
> compooter wrote:
> Kossatsch, yes this is true that it currently only works for individual articles and not article lists. I’m going to do a bit of research and try to find a method in which it can work under both contexts.
If I understand correctly, this is because the software at the technorati end of things can’t distinguish one entry from another — right? If that’s the case, it would seem that we just have to wait for something like a way to associate tags that come up in a list of articles with their appopriate permalink.
Edit: After poking around a bit, I do see sites that display multiple entries and tags, and when I click through to the technorati tag page, the link back is the correct permalink. So, how is this done? On further thinking, it’s probably because I was looking at a wordpress blog that could ping technorati, therefore giving it the appropriate URL. Will that be the solution for Txp, too?
Last edited by schussat (2005-01-23 15:14:32)
-Alan
Offline
#18 2005-01-24 02:54:32
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: Plugin: ajw_technorati_tags
schussat, the individual article / article list issues were solved with v0.4.
Offline
Re: Plugin: ajw_technorati_tags
> compooter wrote:
> schussat, the individual article / article list issues were solved with v0.4.
So I overthought the whole thing, anyway? Good to know.
Still, I remain kind of curious. Say I assign tags to the ten articles currently shown on my main page, and I modify my forms to display the tags next to the posted date. When the main page is viewed, ten articles, together with all of their tags, show up. So what’s to prevent technorati from associating all of those tags with my root URL rather than associating just the appropriate tags with the permalinks of individual articles?
-Alan
Offline
#20 2005-01-24 18:22:08
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: Plugin: ajw_technorati_tags
The problem here exists on several levels.
Ideally, the category tags should be passed via RSS/Atom. I’m not referring to hacking rss.php & atom.php so that they parse plugins and sticking the rel="tag" link in the body of your article. What I’m referring to is actually including the tags in the feeds.
Technorati tags should ideally be attached to textpattern categories in theory, but Txp currently only allows for two categories. Additionally, category support in RSS/Atom is currently broken IMO. Category tags aren’t output at all in Txp’s RSS feed, and the Atom feed only outputs one dc:subject, no matter how many categories your article has.
RSS has supported <code><category></code> since the 0.92 spec & Atom has support for multiple <code><dc:subject>Textpattern</dc:subject></code> tags, so ideally there should be no limit to the amount of categories you could have and both rss.php & atom.php would just loop thru your list of categories and output category/dc:subject tags for as many as you’ve got.
But since this is not the world we live in, we’ve got to make adjustments. Current status, you’ve got a couple options.
- Add technorati rel="tag" to your article pages. I will most likely expand the functionality a bit so that you can conditionally use the “Main Page” tag for the homepage of your site. I’m not quite sure how this’d work exactly, and it’s mainly a kludge, but I’m willing to look into it.
- Hack rss.php & atom.php so that multiple (max 2 as limited by Txp) category tags will be output with your feed. (I’ll write that up soon)
- Sit and punch yourself in the head while you sit in a tub full of pudding, constantly repeating the phrase “textpattern technorati textpattern technorati textorati technattern…”
Offline
#21 2005-01-24 18:42:51
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: Plugin: ajw_technorati_tags
Here’s the small hacks to allow for your categories (max of 2 – as per Txp limit) to be output properly in your RSS/Atom feeds.
RSS category tags
Find this:
<blockquote> <pre> $item = tag(strip_tags($Title),‘title’).n. tag($Body,‘description’).n. tag($link,‘link’).n; $out[] = tag($item,‘item’);</pre> </blockquote>Edit to this:
<blockquote> <pre> $item = tag(strip_tags($Title),‘title’).n. tag($Body,‘description’).n. tag($link,‘link’).n; $item .= ($Category1) ? tag(htmlspecialchars($Category1),‘category’).n : ‘’; $item .= ($Category2) ? tag(htmlspecialchars($Category2),‘category’).n : ‘’; $out[] = tag($item,‘item’);</pre> </blockquote>RSS links category tags
Find this:
<blockquote> <pre> extract($a); $item = tag(doSpecial($linkname),‘title’).n. tag(doSpecial($description),‘description’).n. tag($url,‘link’); $out[] = tag($item,‘item’);</pre> </blockquote>Edit to this: (link feeds really should be expanded to accept multiple categories)
<blockquote> <pre>extract($a); $item = tag(doSpecial($linkname),‘title’).n. tag(doSpecial($description),‘description’).n. tag($url,‘link’).n. tag(htmlspecialchars($category),‘category’); $out[] = tag($item,‘item’);</pre> </blockquote>Atom category tags
Find this:
<blockquote> <pre> $e[‘link’] = ‘<link’.relalt.texthtml.’ href=”’.$elink.’” />’; $e[‘id’] = tag(‘tag:’.$siteurl.’,’.date(“Y-m-d”,$uPosted).’:’.$ID,‘id’); $e[‘subject’] = tag(htmlspecialchars($Category1),‘dc:subject’);</pre> </blockquote>Edit to this (this also fixes empty dc:subject tag bug for non-categorized entries):
<blockquote> <pre> $e[‘link’] = ‘<link’.relalt.texthtml.’ href=”’.$elink.’” />’; $e[‘id’] = tag(‘tag:’.$siteurl.’,’.date(“Y-m-d”,$uPosted).’:’.$ID,‘id’); $e[‘subject1’] = ($Category1) ? tag(htmlspecialchars($Category1),‘dc:subject’) : ‘’; $e[‘subject2’] = ($Category2) ? tag(htmlspecialchars($Category2),‘dc:subject’) : ‘’;</pre> </blockquote>Atom links category tags
Find this:
<blockquote> <pre> $e[‘title’] = tag(doSpecial($linkname),‘title’); $content = utf8_encode(htmlspecialchars($description)); $e[‘content’] = tag(n.$description.n,‘content’,’ type=“text/html” mode=“escaped” xml:lang=“en”’); $url = (preg_replace(“/^\/(.*)/”,“http://$siteurl/$1”,$url)); $e[‘link’] = ‘<link’.relalt.texthtml.’ href=”’.$url.’” />’; $out[] = tag(n.t.t.join(n.t.t,$e).n,‘entry’);</pre> </blockquote>Edit to this:
<blockquote> <pre> $e[‘title’] = tag(doSpecial($linkname),‘title’); $content = utf8_encode(htmlspecialchars($description)); $e[‘content’] = tag(n.$description.n,‘content’,’ type=“text/html” mode=“escaped” xml:lang=“en”’); $url = (preg_replace(“/^\/(.*)/”,“http://$siteurl/$1”,$url)); $e[‘link’] = ‘<link’.relalt.texthtml.’ href=”’.$url.’” />’; $e[‘subject’] = ($category) ? tag(htmlspecialchars($category),‘dc:subject’) : ‘’; $out[] = tag(n.t.t.join(n.t.t,$e).n,‘entry’);</pre> </blockquote>Last edited by compooter (2005-01-24 19:20:10)
Offline
Re: Plugin: ajw_technorati_tags
I made a quick modification to add a label attribute:
<pre>
<code>
function ajw_technorati_tags($atts) {
global $thisarticle;
if (is_array($atts)) extract($atts);
$wrap = (empty($wrap)) ? ‘’ : $wrap;
$break = (empty($break)) ? br : $break;
$label = ((empty($label)) ? ‘’ : $label . (($break 'li') ? '' : $break));
$class = (empty($class)) ? '' : ' class="'.$class.'"';
$field = (empty($field)) ? '' : $field;
$keywords = (empty($field)) ? $thisarticle['keywords'] : fetch("custom_$field", 'textpattern', 'ID', $thisarticle['thisid']);
if (!empty($keywords)) {
$keywords = explode(',',$keywords);
foreach ($keywords as $keyword) {
$keyword = trim($keyword);
$out[] = ($break’li’)
? tag(tag($keyword,‘a’, ‘ href=“http://technorati.com/tag/’.$keyword.’” rel=“tag”’.$class),$break)
: tag($keyword,‘a’, ‘ href=“http://technorati.com/tag/’.$keyword.’” rel=“tag”’.$class).$break;
}
return ($wraptag)
? tag($label . join(n,$out),$wraptag)
: join(n,$out);
}
return;
}</code></pre>
It would be nice if you could modify a plugin and get the new base64 string for it.
Last edited by technoweenie (2005-01-25 15:17:36)
rick
http://techno-weenie.com
Offline
#23 2005-01-24 23:52:53
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: Plugin: ajw_technorati_tags
can you code-ify that a little better? also, label? can you show me an example of the output you’re going for?
Offline
Re: Plugin: ajw_technorati_tags
Well I took out all empty line breaks and played with the pre/code tags and still no luck with the formatting.
I just wanted a label above the tags. I tried to match the pattern of the other txp tags that have a label:
<pre><code>
<txp:related_articles label=”<strong>related articles</strong>” limit=“10” break=”<br />” wraptag=“p” />
<txp:ajw_technorati_tags label=”<strong>tags</strong>” break=”<br />” wraptag=“p” />
</code></pre>
Both render to something like:
<pre><code>
<p><strong>related articles</strong><br><a href=”/1/first-post”>First Post</a></p>
<p><strong>tags</strong><br><a href=“http://technorati.com/tag/test” rel=“tag”>test</a><br></p>
</code></pre>
Last edited by technoweenie (2005-01-25 15:22:17)
rick
http://techno-weenie.com
Offline
#25 2005-01-25 16:12:42
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: Plugin: ajw_technorati_tags
gotcha – i’ve been dealing w/ dns issues the past day. i’ll try and get to that soon.
Offline
Re: Plugin: ajw_technorati_tags
I think Textile is freaking out about the equality operator in your code. Here’s what I added:
<pre><code>
$label = ((empty($label)) ? ‘’ : $label . (($break == ‘li’) ? ‘’ : $break));
</code></pre>
I changed the return line also:
<pre><code>
return ($wraptag)
? tag($label . join(n,$out),$wraptag)
: join(n,$out);
</code></pre>
rick
http://techno-weenie.com
Offline
Re: Plugin: ajw_technorati_tags
Does anyone have an example of this plugin working and being picked up by Technorati? The only way I can get Technorati to use the tags is if I manually put them in the body of the post so that the tags show up in the RSS feed in the BODY of the post… has anyone hacked their RSS/ATOM in the way described above and observed the results in Technorati?
It’s very annoying that being in the body of the actual weblog page(s) isn’t enough!
FYI: I just received a response from Technorati that they are only reading from the RSS feeds…
Last edited by fncll (2005-01-25 19:51:25)
Dammit Jim, I’m a poet, not a programmer…
Joined the TXP Obsessed 2/25/04: http://www.chrislott.org/
Offline
#28 2005-01-25 19:56:12
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: Plugin: ajw_technorati_tags
Well then there ya go. That means the plugin is pretty much for novelty-sake and that if you want to have your posts truly crawled, you’ll need to do the hack described earlier to include categories in the RSS/Atom.
Which kinda sucks because it ties the Technorati tag categories to your Txp categories, which could be very different and are limited to only two.
Offline
Re: Plugin: ajw_technorati_tags
Or hard code the tags into the body of each post. ewww.
How hard would it be to use the logic of the plugin but have it insert into the body of the post in the RSS stream after the body text?
Dammit Jim, I’m a poet, not a programmer…
Joined the TXP Obsessed 2/25/04: http://www.chrislott.org/
Offline
Re: Plugin: ajw_technorati_tags
I suppose, if anything, you can provide links to related entries at Technorati with the tab links…
rick
http://techno-weenie.com
Offline