diff options
-rw-r--r-- | content/posts/2024-12-15-posse/index.md | 2 | ||||
-rw-r--r-- | static/css/rss.css | 386 | ||||
-rw-r--r-- | static/rss.xsl | 71 |
3 files changed, 458 insertions, 1 deletions
diff --git a/content/posts/2024-12-15-posse/index.md b/content/posts/2024-12-15-posse/index.md index 7dd734e..bdfa8b1 100644 --- a/content/posts/2024-12-15-posse/index.md +++ b/content/posts/2024-12-15-posse/index.md @@ -44,7 +44,7 @@ image="posse.jpeg" другими платформами. Далее, я перепилил немного улучшил программку, которую написал уже достаточно давно, которая читает RSS моего блога и -отправляет новые посты в Телеграм канал. +отправляет новые посты в Телеграм канал. Вот она, если что: https://git.neonxp.ru/posse Кстати, в очередной раз напоминаю о [RSS ленте](https://neonxp.ru/feed/) блога. Эта лента — это самый правильный способ подписки на блог! diff --git a/static/css/rss.css b/static/css/rss.css new file mode 100644 index 0000000..f28bf27 --- /dev/null +++ b/static/css/rss.css @@ -0,0 +1,386 @@ +body { + margin: 0px; + padding: 0px; + background: #1e1f21; + color: #6e7073; + font: 11px/18px "Helvetica Neue", Helvetica, Verdana, Arial, sans-serif; +} + +a { + color: #6e7073; + outline: none; +} + +p { + margin: 0 0 20px 0; +} + +ul, ol { + margin-bottom: 20px; +} + +blockquote { + margin: 0 0 0 10px; + padding: 0 0 0 10px; + border-left: 5px solid #f7f7f7; +} + +/* ################################## + BASIC LAYOUT + ################################## */ + +#page { + width: 940px; + margin: 0 auto; +} + +#header { + position: relative; + height: 200px; +} + +#content { + padding: 20px 0 0 0; + background: #fff; +} + +#content-left { + float: left; + width: 600px; +} + +#content-right { + float: right; + width: 320px; +} + +#footer { + +} + +/* ################################## + HEADINGS + ################################## */ + +h1 { + position: absolute; + bottom: 80px; + left: 0px; + margin: 0px; + padding: 0px; + line-height: 1; + font-size: 36px; + font-weight: normal; +} + +h1 a { + color: #fff; + text-decoration: none; +} + +h2 { + margin: 0 0 20px 20px; +} + +h2#blog-description { + color: #ccc; + position: absolute; + bottom: 60px; + left: 0px; + margin: 0px; + padding: 0px; + font-size: 14px; + font-weight: normal; +} + +h3 { + margin: 0 0 20px 0; + font-size: 1.8em; + font-weight: normal; +} + +h3 a { + text-decoration: none; +} + +h3 a:hover { + text-decoration: underline; +} + +h4 { + margin: 0 0 10px 0; + font-size: 14px; +} + +/* ################################## + HEADER + ################################## */ + +#top-nav { + position: absolute; + top: 10px; + right: 0px; + margin: 0px; + padding: 0px; + list-style: none; +} + +#top-nav li { + float: left; + margin: 0 0 0 10px; +} + +#top-nav li#rss { + padding: 0 0 0 15px; + background: url(/img/rss-icon.gif) no-repeat left center; +} + +/* ################################## + CONTENT + ################################## */ + +/** box left */ + +.box-left { + margin: 0 0 40px 20px; +} + +.meta { + clear: both; + padding: 10px; + background: #fff url(/img/bg-meta.gif) repeat-x left top; + color: #5e5e5e; +} + +.meta-date { + padding: 0 10px 0 15px; + background: url(/img/bg-meta-date.gif) no-repeat 0px 2px; +} + +.meta-categories { + padding: 0 10px 0 15px; + background: url(/img/bg-meta-categories.gif) no-repeat 0px 2px; +} + +.meta-comments { + padding: 0 10px 0 15px; + background: url(/img/bg-meta-comments.gif) no-repeat 0px 2px; +} + +p.tags { + clear: both; +} + +/** box right */ + +.box-right { + margin: 0 20px 20px 0; + padding: 20px; + background: #f7f7f7 url(/img/bg-box-right.gif) no-repeat left top; +} + +.box-right ul { + margin: 0 0 5px 0; + padding: 0px; + list-style: none; +} + +.box-right li { + margin: 0px; + padding: 5px; + border-bottom: 1px solid #dedede; +} + +.box-right li a { + text-decoration: none; +} + +/* ################################## + COMMENTS + ################################## */ + +#commentform label { + display: block; + margin: 0 0 5px 0; +} + +#commentform input.text, #commentform textarea { + width: 500px; + margin: 0 0 10px 0; +} + +#commentform .text { + height: 22px; + padding: 6px 6px 0 6px; + background: #fff url(/img/bg-form-text.gif) repeat-x left top; + border: 1px solid #dadada; + color: #5e5e5e; +} + +#commentform textarea { + height: 150px; + padding: 6px 6px 0 6px; + background: #fff url(/img/bg-form-text.gif) repeat-x left top; + border: 1px solid #dadada; + color: #5e5e5e; +} + +#commentform .button { + width: auto; + height: 30px; + margin: 0px; + padding: 0 20px; + background: #4a4f54; + border: none; + color: #fff; +} + +.commentlist { + margin: 0px; + padding: 0px; + list-style: none; +} + +.commentlist .quote { + padding: 20px; + background: url(/img/bg-comment-quote.gif) no-repeat right top; +} + +.commentlist li { + margin: 20px 0 0 0; + padding: 0px; + background: #4a4f54 url(/img/bg-comment-bubble.gif) no-repeat left bottom; + color: #fff; +} + +.commentlist cite { + display: block; + font-style: normal; +} + +.commentlist cite a { + color:#5e5e5e; +} + +.commentlist a { + color:#ffd; +} + +.avatar { + float: left; + margin: 0 20px 10px 0; +} + +/* ################################## + SEARCHFORM + ################################## */ + +#searchform #search { + float: left; + width: 146px; + height: 22px; + padding: 6px 6px 0 6px; + background: #fff url(/img/bg-form-text.gif) repeat-x left top; + border: 1px solid #dadada; + color: #5e5e5e; +} + +#searchform .button { + width: auto; + height: 30px; + margin: 0px; + padding: 0 10px; + background: #4a4f54; + border: none; + color: #fff; +} + +/* ################################## + FOOTER + ################################## */ + +#footer { + width: 900px; + margin: 0 auto; + padding: 20px 0; +} + +#footer p { + margin: 0 0 10px 0; +} + +#legal { + float: left; + width: 400px; +} + +#webdemar { + float: right; + width: 400px; + text-align: right; +} + +/* ################################## + USEFUL + ################################## */ + +.clear { + clear:both; +} + +/** WORDPRESS CSS */ + +.aligncenter, +div.aligncenter { + display: block; + margin: 0 auto; +} + +.aligncenter { + margin-bottom: 20px!important; +} + +.alignleft { + float: left; + margin: 0 20px 20px 0; +} + +.alignright { + float: right; + margin: 0 0 20px 20px; +} + +.wp-caption { + margin-bottom: 20px; + padding-top: 4px; + border: 1px solid #ccc; + text-align: center; + background-color: #f7f7f7; +} + +.wp-caption img { + float: none; + margin: 0px; + padding: 0px; + border: none; +} + +.wp-caption p.wp-caption-text { + padding: 0px; + margin: 0px; +} + +/** WIDGETS CSS */ + +#calendar_wrap table { + width: 100%; +} + +#calendar_wrap td { + text-align: center; +} + +#wp-calendar caption { + margin: 0 0 10px 0; + background: #dedede; +} diff --git a/static/rss.xsl b/static/rss.xsl new file mode 100644 index 0000000..3bfd627 --- /dev/null +++ b/static/rss.xsl @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?><!DOCTYPE xsl:stylesheet [ + <!ENTITY nbsp " "> + <!ENTITY copy "©"> + <!ENTITY reg "®"> + <!ENTITY trade "™"> + <!ENTITY mdash "—"> + <!ENTITY ldquo "“"> + <!ENTITY rdquo "”"> + <!ENTITY pound "£"> + <!ENTITY yen "¥"> + <!ENTITY euro "€"> + +]> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:atom="http://www.w3.org/2005/Atom"> +<xsl:output method="xml" version="1.0" encoding="utf-8" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> +<xsl:template match="/"> + <xsl:apply-templates select="rss/channel"/> +</xsl:template> + +<xsl:template match="rss/channel"> + +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<title><xsl:value-of select="atom:title"/></title> +<link rel="stylesheet" type="text/css" href="/css/rss.css"/> +</head> + +<body> +<h1><xsl:apply-templates select="title"/></h1> +<p>This RSS feed provides the latest posts from <xsl:apply-templates select="title"/>.</p> + +<h2>What is an RSS feed?</h2> +<p>An RSS feed is an XML-based data format that allows publishers to syndicate information. It allows you to stay up to date on topics that interest you—all in one place—without visiting 20-30 different web sites to check for new content. All you need to do to get started is to add the URL (web address) for this feed to your RSS reader.</p> +<p>The URL for this RSS feed is: <xsl:apply-templates select="atom:link"/></p> + +<xsl:apply-templates select="item"/> + +</body> +</html> + +</xsl:template> + +<xsl:template match="item"> + <h2><a href="{link}"><xsl:apply-templates select="title"/></a></h2> + <p><xsl:apply-templates select="description"/></p> + <hr/> +</xsl:template> + +<xsl:template match="title"> + <xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="description"> + <xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="atom:link"> + <a href="{.}"><xsl:value-of select="."/></a> +</xsl:template> + +<xsl:template match="link"> + <a href="{.}"><xsl:value-of select="."/></a> +</xsl:template> + + +</xsl:stylesheet> |