ASP RSS Parser, Mai Karatu

Sanya hotuna 4651719 s

A wannan karshen mako an manna ni a kwamfutar tafi-da-gidanka na neman yanar gizo don masu karanta saƙon RSS. Dalili kuwa shine ina son rubuta RSS RSS mai karanta feed feed wanda zai nuna abincin ta yadda za'a iya cire abun cikin kai tsaye zuwa email din HTML. Don haka ga mutanen da suke son adana wani ɓangare na wasiƙar imel ɗin su don rubutun su na Blog ko na Bugawa, ana iya haɗa shi cikin sauƙi. Tunda JavaScript baya nuna ainihin abun cikin har sai abokin har ya loda ya aiwatar da rubutun, yalwar masu bincike na JavaScript RSS basu da amfani. Ina bukatan mai karanta RSS feed server.

Na fara da rubuta fassarar kaina a cikin ASP ta amfani da abu na MSXML. Na sami damar yin fassarar kusan kashi 75% na abubuwan ciyarwar RSS da ke yin wannan, amma wasu sassauƙan bayanan XML a kan abincin RSS sun kasance da wahalar shirin. Kuna iya ganin sa a aikace nan. Kuna iya ƙaddamar da adadi mafi yawa na abubuwa (ni), adadin haruffa da aka yanke a kalmar (nc), da URL ɗin. Hakanan zaka iya ganin ainihin abincin tare da sauya kuskure nan.

Yawancin ciyarwar RSS da gaske suna 'ƙazanta' kuma suna buƙatar fassarar rubutu a cikin fayil ɗin XML tare da lambar jan layi (ugh!). Tabbas, har yanzu muna cikin RSS 'samari' akan yanar gizo don haka banyi mamaki ba. Kara karantawa game da takamaiman RSS nan.

A ƙarshe, sai na ci karo da ɗan lu'u-lu'u. Na sami ajin ASP kyauta don zazzagewa. Ya ɗan yi jinkiri, amma ban sami abincin da ba zai iya karantawa ba. Ina da tsayayyen siga a nan da fasali mai inganci a nan.

Ma'aurata sun lura da rubutun. Ina buƙatar share wasu alamun HTML a cikin bayanan da aka dawo. Na yi haka tare da ɗan aikin tsaftacewa na samo:

Aiki cire HTML - 1) & Mid (strText, nPos2 + 1) Sauran Fita Kada Karshen Idan nPos1 = InStr (strText, ">") Madauki Cire HTML = StrText End Aiki

Na kuma ƙara wani ɗan ƙaramin abu mai kyau: Wani lokaci, Ina iya so in nuna ƙari ko ofasa na bayanin. Koyaya, idan kawai na iyakance adadin haruffa, to zan iya yanke bayanin a tsakiyar kalmar. Ba na so in yi haka!

Aiki Cutoff (strText, intChars) dim intLength dim j intLength = len (strText) idan intChars> intLength to don j = intChars zuwa 0 mataki -1 idan tsakiyar (strText, j, 1) = "" to, fita don gaba idan j> 0 sannan strText = hagu (strText, j-1) & "..." sai kuma strText = strText karshen idan ya kare idan Cutoff = Aikin Karshen strText

(Ina da wasu matsaloli game da nuna lambar ta daidai a cikin wannan shigarwar… ku sanar dani idan kuna da matsala game da ɗayan waɗannan ayyukan!)

Na lura da wasu kayan aikin da yawa a yanar gizo. Akwai
.NET sigar, nau'ikan nau'ikan PHP da yawa, nau'in juzu'in JavaScript.

A ƙarshe, Ina fatan cewa takamaiman bayanan RSS sun ci gaba da kasancewa mai ladabi kuma ainihin ciyarwar suna bin ƙa'idodin XML a cikin kowane yanayi. Aikace-aikace kyauta kamar TypePad, WordPress, da sauransu suna buƙatar tsaftace ayyukansu na RSS. Blogarin blogs kamar MySpace, Xanga, LiveJournal, da sauransu suna buƙatar haɓaka ayyukansu na RSS. RSS mai iko ne…Chris Baggott ya rubuta yanki mai kyau akan Email vs. RSS. Ina tsammanin hada ayyukan su na iya kara tasirin su biyun!

Me kuke tunani?

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.