RSS и Blog Submissions


New Member
Добавяне на динамичен RSS в блога


#      (c) Valentin Stoykov [url][/url]

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or 
# (at your option) any later version.

# This program is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA02111-1307, USA.

use locale;
use encoding 'utf8';
use utf8;
use Encode;

use strict;
use POSIX;

my $how_many_random_news=5;

my $data = <<END_OF_DATA;
[url][/url] Bacula – a network backup solution
[url][/url] bcrypt: A lightweight blowfish file encryption utility
[url][/url] BCWipe: Securely erase data from magnetic and solid-state memory
[url][/url] BRU: a backup solution for Linux and UNIX
[url][/url] Clam AntiVirus
[url][/url] Darik's Boot and Nuke: A boot floppy that wipes hard disks
[url][/url] Data Recovery Tips
[url][/url] dd_rescue - a block copier, which ignores errors
[url][/url] dd_rhelp: a quick and easy data recovery manager
[url][/url] A forensic and incident response bootable CD and security tools
[url][/url] gET iT i sAY: A file recovery tool for Ext3 and Ext2
[url][/url] GNU ddrescue – a data recovery tool
[url][/url] gzip Recovery Toolkit: Attempts recovery on corrupted .gz and .tar files
[url][/url] Mondo Rescue - GPL disaster recovery solution
[url][/url] Parchive: a tool that helps data recovery of multi-part archives on Usenet
[url][/url] Re-Source Hardware
[url][/url] RESTORE - an enterprise and Data Center backup and data restore solution
[url][/url] ReStoring Data Inc.
[url][/url] Safecopy: A Commandline Data Recovery Tool
[url][/url] SAGATOR: An email antivirus/antispam gateway for any smtpd
[url][/url] Scratch Busters to restore CD/DVD
[url][/url] Scrounge NTFS - a data recovery program for NTFS filesystems
[url][/url] Seagate Recovery Services
[url][/url] Sector Logics Inc
[url][/url] SOS HD Data Recovery
[url][/url] Southwest Stars
[url][/url] SquidClamAv: a ClamAV antivirus redirector for Squid
[url][/url] TestDisk: free and open source data recovery software
[url][/url] Toba Data Recovery
[url][/url] WIPE - a tool that offers secure deletion of files from magnetic media
[url][/url] zeroer: A command line utility for wiping unallocated space on a filesystem
[url][/url] A GUI for rsync using GTK
[url][/url] FD crystals datasheet
[url][/url] Fox Electronics now offers expanded range of low-profile, high-frequency fundamental mode quartz crystals
[url][/url] High-frequency fundamental mode SMD quartz crystals
[url][/url] 32.768kHz surface mount cost-effective miniature tuning fork
[url][/url] Cost-effective miniature tuning fork
[url][/url] Fox Electronics introduces cost-effective miniature tuning fork
[url][/url] FX135A tuning fork
[url][/url] FX135B tuning fork
[url][/url] New configurable oscillators from Fox provide fixed frequency electrical performance at a lower price
[url][/url] High performance XpressO oscillators
[url][/url] LVDS and LVPECL oscillators
[url][/url] New low-cost oscillators provide low jitter and enhanced performance
[url][/url] FHS501AH oscillator datasheet
[url][/url] New Half-Size OCXO provides extreme stability for portable devices
[url][/url] Board to board connectors
[url][/url] Electric test clips
[url][/url] Insulator boots
[url][/url] Mueller Electric Company Inc.
[url][/url] Test leads
[url][/url] New, Low-Jitter voltage controlled crystal oscillators allow more data to be transmitted
[url][/url] XpressO family of VCXO oscillators datasheets
[url][/url] FTS310 datasheet
[url][/url] HCMOS, 14-pin DIP OCXO (Oven Controlled Crystal Oscillator)
[url][/url] New OCXO for WiMax Base Station Applications
[url][/url] FTS310 datasheet
[url][/url] New OCXO for WiMax Base Station Applications
[url][/url] F330A and F530LA oscillators datasheets
[url][/url] Fox's RoHS compliant F330A and F530LA oscillators
[url][/url] Low Current Oscillators From Fox Extend Battery Life In Portable Applications
[url][/url] AVX’s high-reliability catalog highlights expanded product offering
[url][/url] Download AVX’s High Reliability catalog
[url][/url] 456 Series fuse offers high-amp circuit protection in a tiny package compatible with faster pick and place electronics assembly processes
[url][/url] Littelfuse Introduces Industry’s First 125V Subminiature Surface Mount Fuse with Current Rating Above 15A
[url][/url] AVX delivers low ESR and fused tantalum capacitors for mission critical applications
[url][/url] Low ESR and fused tantalum capacitors
[url][/url] charge-management controllers
[url][/url] MCP73837 and MCP73838 dual-input, high-current Li-Ion/Polymer charge-management controllers
[url][/url] Microchip Technology Introduces Li-Ion/Li-Polymer Chargers With Auto USB or AC Power-Source Selection
[url][/url] AVX’s mobo compression interconnect catalog highlights expanded product offering
[url][/url] Download MOBO catalog (mobocat.pdf)
[url][/url] Microchip Technology Adds More Flash Memory to the World’s Smallest Low Cost Digital Signal Controllers
[url][/url] Six New dsPIC33F Low Pin Count Digital Signal Controllers
[url][/url] AVX releases new tantalum/oxicap capacitor simulation software
[url][/url] Download the SpiTan II V 1.5 software
[url][/url] SpiTanII V 1.5 details hundreds of new parts
[url][/url] AVX’s tantalum capacitors address embedded systems applications
[url][/url] LT3518: 45V, 1.3A/2.3A LED Drivers for Boost, Buck or Buck-Boost High Current LED Applications
[url][/url] High Output Voltage Dual Output 100% Duty Cycle Step-Down or Current Source DC/DC Controller
[url][/url] LT3742 datasheet
[url][/url] LT3742: Dual Output 100% Duty Cycle High Output Voltage Step-Down or Current Source DC/DC Controller
[url][/url] LTC2753-16: Dual 16-Bit Current Output DAC Provides Six Unique Software Programmable Output Ranges, ±1LSB INL & DNL
[url][/url] LTC285xH: RS422/RS485 Transceivers Guaranteed over High Temperatures for Automotive Applications
[url][/url] LTC6652: 5ppm/°C Voltage Reference Features Very Low Noise
[url][/url] Tantalum and Oxicap® capacitors deliver the gold standard for audio applications
[url][/url] $1 Image Stabilizer For Any Camera
[url][/url] Cheap image stabilizer video
[url][/url] All-Quartz SMD Crystal Series to Include 3.2 mm x 2.5 mm Package Size
[url][/url] FQ3225B datasheet
[url][/url] Atlantese - sales representative organisation specialising in RF and Microwave devices, components, antenna assemblies, and systems and subsystems
[url][/url] EDN's Design Ideas: Cascade two decade counters to obtain 19-step sequential counter
[url][/url] EDN's Design Ideas: Depletion-mode MOSFET kick-starts power supply
[url][/url] EDN's Design Ideas: Dual-input sample-and-hold amplifier uses no external resistors
[url][/url] EN-Genius Network
[url][/url] EDN's Design Ideas: High-speed clamp functions as pulse-forming circuit
[url][/url] How to make PCB videos
[url][/url] Videos: How to make PCB
[url][/url] EDN's Design Ideas: Improved optocoupler circuits reduce current draw, resist LED aging
[url][/url] Input Clock Adjusts Frequency Of Digital Ramp Generator
[url][/url] Linear Technology Corporation
[url][/url] Littelfuse expands TVS diode product line
[url][/url] New higher power and lower capacitance TVS diodes
[url][/url] Fox Offers New Low Power Consumption Oscillator for Portable Applications
[url][/url] HCMOS ceramic surface mount oscillator
[url][/url] 360mA Universal 18-Channel LED Driver
[url][/url] LTC3220/-1 datasheet
[url][/url] LTC3220/-1: Universal LED Driver Features 360mA Output Current, Independent Control Of 18 LEDs with Low Noise and up to 91% Efficiency
[url][/url] LTC3220/LTC3220-1 datasheet
[url][/url] LTC3527/-1 datasheet
[url][/url] LTC3527/-1: Dual 800mA & 400mA (ISW), 2.2MHz Synchronous Boost Regulator with Output Disconnect in a 3mm x 3mm QFN
[url][/url] LTC3527/-1 dual output 2.2MHz
[url][/url] Buck-Boost & Dual Buck Regulator
[url][/url] LTC3556 datasheet
[url][/url] LTC3556: Switch Mode USB Power Manager, Buck-Boost & Dual Buck Regulator PMIC Maximizes Battery Runtime & Minimizes Heat
[url][/url] Switch Mode USB Power Manager
[url][/url] Features of the PIC16F526 and PIC12F519
[url][/url] Microchip Technology Adds Flash Data Memory to the Baseline PIC® Microcontroller Architecture
[url][/url] OCXO, Oven Controlled Crystal Oscillator
[url][/url] Radio and electronics tutorials
[url][/url] Radio and electronics tutorials, news and information
[url][/url] - radio and electronics tutorials, news and information
[url][/url] Selective Soldering Systems
[url][/url] EDN's Design Ideas: Simple continuity tester fits into shirt pocket
[url][/url] Simple continuity tester
[url][/url] Simple soft-start circuit for switching regulators
[url][/url] A compact, low power consumption 32.768 kHz HCMOS surface mount oscillator
[url][/url] Fox Introduces a small, low power consumption oscillator for time-keeping
[url][/url] EDN's Design Ideas: Use the MCLR pin as an output with PIC microcontrollers
[url][/url] EDN's Design Ideas: White LED shines from piezoelectric-oscillator supply
[url][/url] White LED with piezoelectric-oscillator supply
[url][/url] Antigravity
[url][/url] ASUS EeePC review: Why it was love at first sight
[url][/url] The Coanda Effect demonstration
[url][/url] Coanda Effect RC Flying Saucer test flight
[url][/url] Equivalent Series Resistance Meter
[url][/url] ESR Meter
[url][/url] Gimp Tutorial - Fast Flaming Text
[url][/url] How to Find RSS Feeds
[url][/url] How to walk in non-newtonian fluid
[url][/url] How to walk on non-newtonian fluid
[url][/url] Links
[url][/url] LT1912: 36V, 2A(IOUT), 500kHz Step-Down DC/DC Converter in 3mm x 3mm DFN
[url][/url] 16-/12-Bit ADCs in MSOP Packages Guaranteed to +125°C
[url][/url] LTC1860 Datasheet
[url][/url] LTC1860 LTC1861 Datasheet
[url][/url] LTC1860 LTC1861 LTC1864 LTC1865: Pin- & Software-Compatible 16-/12-Bit ADCs in MSOP Packages Guaranteed to +125°C
[url][/url] LTC1861 Datasheet
[url][/url] LTC1864 Datasheet
[url][/url] LTC1864/LTC1865: 16-Bit Resolution 250ksps Sample Rate SAR ADCs 
[url][/url] LTC1864 LTC1865 Datasheet
[url][/url] LTC1865 Datasheet
[url][/url] Single 5V Supply, 250ksps, 16-Bit Sampling ADC
[url][/url] 12-Bit, 1-/2-Channel 500ksps SAR ADCs Offer Compact Solution Size and Low Power
[url][/url] LTC2302 and LTC2306: 12-Bit, 1-/2-Channel 500ksps SAR ADCs Offer Compact Solution Size and Low Power
[url][/url] LTC2302 LTC2306 Datasheets
[url][/url] Autonomous high efficiency power manager, battery charger and ideal diode controller
[url][/url] LTC4098 datasheet
[url][/url] LTC4098: High Efficiency USB Power Manager & Li-Ion Battery Charger Delivers 700mA to System Load from USB and OV Protection
[url][/url] Real Footage: UFOs Made in Germany
[url][/url] X-UFO full test flights with the X3D board
[url][/url] List of Linux HOWTOs
[url][/url] Free data recovery and backup software
[url][/url] Desoldering SMD components using iron
[url][/url] How to desolder SMD components with a iron (video)
[url][/url] How to desolder SMT components with a iron (video)
[url][/url] How to make your own circuitboards
[url][/url] How to make your own PC boards (video)
[url][/url] How to make your own PCBs (video)
[url][/url] Etching a PCB
[url][/url] Etching a PC board (video)
[url][/url] Etching a Printed Circuit Board (video)
[url][/url] How to make a PCB in 10 minutes
[url][/url] How to make a PCB in 10 minutes with a laser printer and iron (video)
[url][/url] Making PCB in 10 minutes with a laser printer and iron (video)
[url][/url] How to make circuit board with laser printer
[url][/url] How to make PC board with laser printer
[url][/url] How to make PCB with laser printer
[url][/url] PCB HOWTOs
[url][/url] PC Boards HOWTOs
[url][/url] Printed Circuit Board HOWTOs
[url][/url] How to make PCB with a laser printer (video)
[url][/url] Making PCB
[url][/url] Howto PCB etching with laser printer and inkjet picture paper (video)
[url][/url] PCB etching with inkjet picture paper and laser printer
[url][/url] PCB Etching Machine
[url][/url] PC Board Etching Machine (video)
[url][/url] Printed Circuit Board Etching Machine (video)
[url][/url] How to repair a circuit board trace (video)
[url][/url] How to repair a PCB trace
[url][/url] How to repair a PCB trace (video)
[url][/url] PCB HowTo
[url][/url] Free and open source PCB design software
[url][/url] 60 pounds of dry ice and a swimming pool
[url][/url] Coanda Effect demonstration of working principle
[url][/url] Coanda Effect Flying Saucer demo
[url][/url] Coanda Effect RC Flying Saucer test flight
[url][/url] Coanda Effect with a balloon
[url][/url] Coanda UAV
[url][/url] Dry Ice Bomb
[url][/url] Dry Ice Bomb under Ice
[url][/url] Dry ice experiment
[url][/url] High Speed flight with the QRO v2.1 MAV
[url][/url] Honeywell micro air vehicle
[url][/url] Liquid Nitrogen Into A Swimming Pool
[url][/url] Non-Newtonian Fluid
[url][/url] OpenSource Quadrocopter
[url][/url] A pool filled with non-newtonian fluid
[url][/url] Sphere of water (zero gravity)
[url][/url] UFO-Antigravity or Coanda Effect man made saucers or planes
[url][/url] Underwater C02 Bomb (Dry Ice)
[url][/url] Midnight Commander with UTF-8 support
[url][/url] Dynamic DNS service
[url][/url] Using USB memory sticks with Slackware Linux
[url][/url] Wput - opposite of wget


# === Край на настройките, редактирани от потребителя ===

my $template_link = <<END;

my $template_area_of_links = <<END;
<?xml version="1.0"?>
<rss version="2.0">
      <description>Random links.</description>



sub fix_broken_url {
my $this_url=$_[0];  $this_url=~ s/&(?!amp;)/&amp;/g;  return $this_url;

sub strToHTML {
  my $text = shift;
  $text =~ s|\&|\&amp\;|g;      # convert all '&' to "&amp;" (must be first)
  $text =~ s|\"|\&quot\;|g;     # convert all '"' to "&quot;"
  $text =~ s|<|\&lt\;|g;        # convert all '<' to "&lt;"
  $text =~ s|>|\&gt\;|g;        # convert all '>' to "&gt;"
#  $text =~ s|\n|
\n|g;       # convert all line feeds to "
" and line feed
  return $text;
} # end sub strToHTML

# Прочита цял файл
sub load_entire_file {
my $data; undef $/; # Разделителят на входни записи се изпразва - чете се целия файл наведнъж
 open(DAT, $_[0]) || die "Грешка при отваряне на файла $_[0]\n";
   binmode(DAT,':utf8'); # четене на файл с кодиране Уникод UTF-8
return $data;

# Записва html файл.
# Ползване: write_html_file("файл",$съдържание);
sub write_html_file {
my $ofile=$_[0];
my $htmlcode=$_[1];
  open(outpF, ">".$ofile);
  binmode(outpF,':utf8'); # запис на файл с кодиране Уникод UTF-8
  print outpF $htmlcode;

# ** Създаване на масиви с информация за връзките **

my @lines = split /\n/, $data;
my $line;

my @links_title;
my @links_url;
my @links_description;

my $pattern_all='\s\S';
my $pattern_url='\S';

foreach $line (@lines) {

if ($line=~m#([$pattern_url]+) ([$pattern_all]+)# ) {
push @links_url,fix_broken_url($1);
push @links_title,fix_broken_url(strToHTML($2)); # compatible with Blogger
push @links_description,strToHTML($2);


# *** Подпрограми ***

# Генерира $_[0] случайни числа от 0 до $_[1]
sub make_array_of_uniq_random_nubmers {
my %random_numbers;
my @arr;
my $random_number;
my $how_many="$_[0]";
my $range="$_[1]";

# ако броят на случайните числа, които трябва
# да се генерират е по-голям от броя на възможните:
if ( $how_many > $range  ) { $how_many = $range }

while (($#arr+1) < $how_many ) {
$random_number = int(rand($range));
$random_numbers{$random_number." "}="";
@arr = keys %random_numbers;

return @arr;

# параметър: брой на желаните случайни новини
sub make_random_news {
my $this_lnk;
my @arr = make_array_of_uniq_random_nubmers($_[0],$#links_url);
my $this_item;
my $tmp;
my $area=$template_area_of_links;

	foreach $this_lnk (@arr)  {
	 $this_item=~ s/__title__/$links_title[$this_lnk]/g;
	 $this_item=~ s/__url__/$links_url[$this_lnk]/g;
	 $this_item=~ s/__description__/$links_description[$this_lnk]/g;
$area=~ s/__insert_links_here__/$tmp/g;
return $area;

my $news = make_random_news($how_many_random_news);

print "Content-type: application/xhtml+xml\n\n";

print $news;

Скрипта в действие:

Идеята на този скрипт е да се направи съдържанието на блога динамично (Blogger поддържа RSS feeds и от време на време проверява за промени и актуализира страниците).

Текста от "my $data = <<END_OF_DATA;" до "END_OF_DATA" е списък с връзки в много прост формат („адрес текст“ следващ ред „адрес текст“ и т.н. (има един интервал между адреса и текста)). С променливата $how_many_random_news се определя колко случайни връзки да се генерират.

Написал съм и други скриптове (напр. автоматично добавяне на нови връзки в списъка), но ще ги публикувам друг път (когато ги приведа в по-приличен вид).

Blogger кешира данните, получени от RSS. Ако желаете да обновите страниците си веднага (вместо да чакате на Blogger да му мине случайния интервал от време, след който се обновява кеша), редактирайте адреса на RSS-а като добавите „?някакъв_случаен_низ“:


New Member
georgimateev каза:
Т'ва горното огромното защо не го научите да си взима динамично линковете и заглавията? ;)

Може да се направи при всяко стартиране да се проверява дали едно случайно число е равно на някаква константа и ако се наблюдава равенство да тегли RSS от други сайтове и да ги добавя във файл (напр. средно на всеки 10 посещения), но ако е на безплатен хостинг собственикът няма да е много доволен (обикновено го пише в условията за ползване: скрипта, стартиран на сървъра да не взима съдържание от други сайтове, което правят например уеб прокситата от рода на php proxy). Ако хостингът поддържа crond ще отпадне проверката на случайното число дали е равно на някаква константа.

Тази забрана се заобикаля като обновяването на скрипта става на друг компютър и се качва чрез ръчно стартиране на един скрипт, който си събира каквото трябва от където трябва.


Well-Known Member

така го обясни че сякаш всички сме програмисти :D и пак неможах да загрея кое от какво взима :D


New Member

така го обясни че сякаш всички сме програмисти :D и пак неможах да загрея кое от какво взима :D

Извинете за въпроса, но тези скрипт с рандом постовете на RSS, къде точно да го събмитна ? Знам, че Гугъл харесва чести промени по съдържанието на даден сайт, на това в случая е RSS фийд, и не зацепвам какво Гугъл може да направи с нея... ?


New Member
един може би странен въпрос от мен: събмитвате ли фийдс в изброените директории от сайтове с български кънтент? Доколкото виждам директориите са нон бг и не знам има ли смисъл да събмитвам rss от един мой кирилишки блог :)
ако не къде събмитвате такива?


Аз лично мисля че няма смисъл, бате. Все пак като не го разбират езика няма да те четат даже и да излезеш в някоя директория за дадена категоря. Но все пак са много, може да се поразровиш дали някои имат и други езици. Малко ме съмнява за нашият, но все пак проба-грешка.:)


Добре си дошъл бате. Кофти е, но нямаме още добре затвърдени блог директории на български. Пропуск, но факт. И това ще се развие скоро.:) Ето идеят за някой, който иска да оперира в тази ниша. Може да избира между няколко модела - блог директория, Rss feed агрегатор, Бг Диг.....:)


New Member
Навсякаде ли бухате rss-feedо-вете,да докарват всякакв трафик? Или си подбирате директориите да идва само таргетиран трафик? Щото не в всяка директория има примерно за хазарт както е в моя случеи, и се чудя наред ли да дера, или да подбирам.


Еми то е хубаво да идва повече трафик, от къде ли не. А и да в не всяка директория има категория отговаряща на тематика на даден блог, но винаги може да се намери сходна или близка до нея. Примерно в твоят случай е Забавления -> Игри....

Аз лично наред ги опрашвам:) Все си намирам категория. Даже малко или много блога ти е инфо ресурс, което може да попадне и в категоря - Education.:) Зависи колко си алчен за трафик от този вид стратегия.:)