Yesterday I created an
RSS feed for my blog. Now, if I can keep writing constantly, it will be possible to read my notes promptly.
I know that the vast majority use wordpress or other blog engines, so I can send them immediately to the
second part of the note. I have completely hand-made - I hope I’m not the only one-of-a-kind newbie maniac, and my colleagues will also be interested in reading.

When writing the script, the
specification and two articles of the type “RSS for PHP” were used:
here everything is painted briefly and clearly, right down to the finished code;
it is more generalized
here , but data input and output are also considered (in my case, absolutely not needed at the moment).
So, the
script was compiled on the go for 10 minutes, but ... refused to work . I had to wait until the evening when I got home, to the Internet. Here is the experience acquired at this stage and it makes sense to share.
First, I would like to draw your attention to the fact that the language
<language> ru </ language> does not exist. A dozen rss feeds were explored - everyone uses
en or
en-us . Although, in principle, the specification politely reports that there are other language tags, referring to some other standard, it does not look at the other list of standards - in general, I didn’t know if the stream could be officially Russian.
')
And in order for all this to work,
encoding = "UTF-8" is indicated directly in the
xml tag or (I don’t have everything like people)
encoding = "windows-1251" .
In case if html is used in news description, the text is in
<! [CDATA [...]]> - about this, in the articles above, it seems, was not.
Here is the first part and that's it. I will add only that I had to drive IE7 to test the flow for validity - it is the only one of my entire set of browsers that reports specific errors, and then, as it turned out, this is not quite right - in my case it cursed the title “B” in the channel description :( But IE6 offers to save streams to a PC, after which they can be “dissected” at their own discretion.
And now the promised
second part .
Then your humble servant decided to use the services of the
FeedBurner service, which provides owners of RSS feeds with detailed statistics and a sea of ​​all sorts of other amenities that I don’t know yet.
After registering on the service (a large text box with a button on the main page), I received a choice of a bunch of materials, what should I do next if I had a blog on Blogger, Wordpress, MySpace, etc. About man-made wonders, of course, not a word.
So, by trial and error, it is established: a new channel address like
feeds.feedburner.com/JustKitich is inserted only into the
link in the blog template, everything else (the stream generation script itself) remains unchanged.
Step 2. I want a beautiful button with the number of readers. For example, I scored on FeedBurner and tried to extract the button code from the first blog I got - it was not there. I still had to find where it is located on the service and ... activate the service! By the way, there is also a bunch of “subscribe through your favorite news reading service” buttons nearby. And all this in the section
Publicize - FeedCount and friendly graphic links, respectively.
Step 3. Collect statistics. The script is used, it is placed (as a rule) in the “head” part of the blog template. I’m hidden far away at FeedBurner - I can’t even find it again now, but it doesn’t require activation, so here’s the code:
< src='http://feeds.feedburner.com/~s/JustKitich?i=...' type='text/javascript' charset='utf-8'></>
instead of "...", the address of the current note is inserted, and instead of the
script (Habra feature).
Now I explain: this current address is needed so that the script knows where it is called from and entered the corresponding page in the statistics. I have seen on many blogs the type of horrors from notes, the script sends a link to a note, and from all other pages - a link to the last note. IMHO wrong somehow. At myself, for example, I hung up the following code:
<?
if ($page_curr == 'blog') {
if ($id>0)
print "";
else
print "";
}
?>
that is, the script is displayed only in the blog (I also have other sections), and in the notes we send the address of the note, otherwise - just the main blog. Let's see how it will work now.
On this, in fact, that's all. I personally have no more questions. Glad if anybody else comes in handy.
Original -
here