ASP RSS Parser, Mea heluhelu Hānai

Depositphotos 4651719 s

I kēia hopena pule ua kāpili ʻia wau i kaʻu kamepiula lawe e ʻimi nei i ka ʻupena no nā mea heluhelu hānai RSS pūnaewele. ʻO ke kumu makemake wau e kākau i kahi mea heluhelu hānai RSS e hōʻike i ka hānai i hiki ai ke ʻokiʻoki ʻia i ka ʻike i loko o kahi leka uila HTML. No laila no nā poʻe e makemake e hoʻopaʻa i kahi ʻāpana o kā lākou leka uila no kā lākou Blog a i ʻole nā ​​ʻatikala Publication, hiki ke hoʻohui maʻalahi ʻia. Ma muli o ka hōʻike ʻole ʻana o JavaScript i ka ʻike a hiki i ka manawa a ka mea kūʻai aku e hoʻouka ai a hoʻokō i ka palapala, ʻaʻole pono ka nui o nā polokalamu kele pūnaewele RSS RSS. Pono wau i kahi mea heluhelu hānai RSS ʻaoʻao pūnaewele.

Ua hoʻomaka wau ma ke kākau ʻana i kaʻu parser ponoʻī i ASP me ka hoʻohana ʻana i ka mea MSXML. Ua hiki iaʻu ke ʻoki ma kahi o 75% o nā hānai RSS e hana ana i kēia, akā ʻo kekahi o nā kikoʻī XML leʻaleʻa i nā hānai RSS he paʻakikī loa i ka polokalamu. Hiki iā ʻoe ke ʻike ma ka hana maanei. Hiki iā ʻoe ke hoʻolilo i ka helu max o nā mea (ni), ka helu o nā huapalapala i ʻoki ʻia i ka huaʻōlelo (nc), a me ka URL. Hiki iā ʻoe ke ʻike i ka hānai maoli me kahi loli debug maanei.

ʻO ka nui o nā hānai RSS he 'lepo' maoli ia a koi ʻia i ka haʻi ʻana i ka huaʻōlelo i ka faila XML me ke code manipulation string (ugh!) ʻOiai, aia nō mākou i kā mākou RSS 'ʻōpio' ma ka ʻupena no laila ʻaʻole wau e kahaha. E heluhelu hou aʻe e pili ana i nā kikoʻī RSS maanei.

I ka hopena, ua ʻike wau i kahi momi liʻiliʻi. Ua loaʻa iaʻu kahi papa ASP manuahi e hoʻoiho ai. Ua lohi iki ia, akā ʻaʻole i loaʻa iaʻu kahi hānai hiki ʻole ke heluhelu. Loaʻa iaʻu kahi mana kūpaʻa ma aneʻi a me kahi mana hoʻoiho maʻaneʻi.

Kahi mau puke ma ka script. Pono wau e hoʻomaʻemaʻe i kekahi mau lepili HTML i nā hōʻike i hoʻihoʻi ʻia. Ua hana wau i kēlā me kahi hana hoʻomaʻemaʻe liʻiliʻi i loaʻa iaʻu.

Hana HanaHTML (strText) Dim nPos1 Dim nPos2 nPos1 = InStr (strText, ">") Hana ʻoiai nPos1> 0 nPos2 = InStr (nPos1 + 1, strText, ">") Inā nPos2> 0 A laila strText = Haʻalele (strText, nPos1 - 1) & Mid (strText, nPos2 + 1) puka ʻē aʻe kahi e hoʻopau inā nPos1 = InStr (strText, ">") Loop DeleteHTML = strText End Function

Ua hoʻohui pū wau i kahi liʻiliʻi ʻē aʻe o ke code: I kekahi manawa, makemake wau e hōʻike i kahi ʻoi aku a ʻoi paha o kahi wehewehe. Eia nō naʻe, inā kau palena wale wau i ka helu o nā huapalapala, a laila ʻokiʻoki paha wau i ka wehewehe ma waena o ka huaʻōlelo. ʻAʻole wau makemake e hana i kēlā!

Lae Hana 0 a laila strText = hema (strText, j-1) & "..." ʻē aʻe strText = strText pau inā pau inā Cutoff = strText End Function

(Ua loaʻa iaʻu kekahi mau pilikia me ka hōʻike pololei ʻana i kaʻu code i kēia komo ʻana ... e haʻi iaʻu inā he pilikia kāu me kekahi o kēia mau hana!)

Ua ʻike wau i kekahi mau mea hana hou aʻe ma ka ʻupena pū kekahi. Aia kahi
.net mana, nā mana PHP he nui, he tona o nā mana JavaScript.

I ka hopena, lana koʻu manaʻo e hoʻomau ʻia ka hoʻomaʻemaʻe ʻana o RSS kikoʻī a hoʻokō pono nā hānai maoli i nā kūlana XML i nā hihia āpau. Pono nā polokalamu manuahi e like me TypePad, WordPress, a me nā mea ʻē aʻe e hoʻomaʻemaʻe i kā lākou hana RSS. Pono nā blog e like me MySpace, Xanga, LiveJournal, a me nā mea ʻē aʻe e hoʻomaikaʻi i kā lākou hana RSS. Maikaʻi loa ʻo RSS…ʻO Chris Baggott i kākau i kahi ʻāpana maikaʻi ma ka Email vs. RSS. Manaʻo wau i ka hoʻohui ʻana i kā lākou hana hiki ke hoʻonui i ka hopena o nā mea ʻelua!

Pehea kou manaʻo?

Ke hoʻohana nei kēia pūnaewele i ka Akismet e ho'ēmi i ka spam. E aʻo pehea e hanaʻia ai kāuʻikeʻikepili.