University of Hertfordshire BACHELOR OF SCIENCE DEGREE WITH HONOURS IN COMPUTING & Un NETWORKS TECHNOLOGY ive Final Year Project Report Department of Electronic, Communication and Electrical Engineering yO t rsi RSS Based news Feeds for Information Gathering fH Report by Supervisor Felix Zhu ire sh April 2006 rd tfo er Timothy James Coup Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report DECLARATION STATEMENT I certify that the work submitted is my own and that any material derived or quoted from the published or unpublished work of other persons has been duly acknowledged Un (ref. UPR AS/C/6.1, Appendix I, Section 2 – Section on cheating and plagiarism) ive Student Full Name: Timothy James Coup Student Registration Number: 03070937 yO t rsi Signed: ………………………………………………… ire sh rd tfo er fH Date: 06 June 2006 Page 2 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report ABSTRACT RSS based news feeds are empowering users and delivering content where and when they require it. RSS News feeds are providing an increasing important role as a Un delivery medium for people to distribute information in our overloaded information society. This report aims to explore how RSS News Feeds can be used and ive implemented using a combination of technologies. The report shall explore in detail how to use own and third party RSS feeds, create a secure interface to make own RSS feeds editable and the ability to search RSS News feeds using keywords. ire sh rd tfo er fH yO t rsi Page 3 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report ACKNOWLEDGEMENTS The author would like to thank Project supervisor Felix Zhu who has given thorough and reliable guidelines through the project. Un Special thanks to the following people for there support and assistance: ive Felix Zhu For support throughout the project and being a source of motivation to strive to t rsi achieve high levels of work through the project. Johann Siau & Laboratory staff yO For providing and maintaining servers and lab equipment. ire sh rd tfo er fH Page 4 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report TABLE OF CONTENTS DECLARATION STATEMENT Page 2 Un Page 3 ACKNOWLEDGEMENTS Page 4 TABLE OF CONTENTS Page 5 t rsi ive ABSTRACT LIST OF FIGURES yO GLOSSARY 1. INTRODUCTION 1.1 PROJECT AIMS 1.2 OBJECTIVES 1.3 CONSTRAINTS Page 9 Page 10 TECHNICAL CHALLENGES 2.2 FORESEEN ISSUES 2.3 RESOURCE ANALYSIS 2.4 RISK ASSESSMENT 2.5 STAGES OF WORK 2.6 TIME PLAN Page 10 Page 10 Page 11 Page 11 Page 12 sh 2.1 Page 12 Page 14 ire RESEARCH Page 9 rd tfo FEASIBILITY STUDY Page 9 er 3. Page 8 fH 2. Page 7 Page 15 3.1 HISTORY OF RSS Page 15 3.2 USE AND EXAMPLES Page 15 3.3 TECHNOLOGIES OF RSS Page 17 3.4 SUMMARY & FUTURE Page 18 Page 5 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire 4. BSc./BEng. Final Year Project Report DESIGN & IMPLEMENTATION Page19 4.1 HOMEPAGE Page 19 4.2 OWN RSS FEED Page 20 Un 4.3 EDIT OWN RSS FEED Page 24 Page 29 4.3.2 LOGIN EDIT FEED Page 30 4.4 THIRD PARTY FEED Page 31 4.5 SEARCH FUNCTION Page 31 4.6 SITE NAVIGATION Page 36 5. t rsi ive 4.3.1 STYLE SHEET EDIT OWN FEED TESTING Page 37 yO 5.1 TESTING METHODOLOGY Page 37 5.2 TESTING RESULTS Page 38 FUTURE DEVELOPMENTS Page 40 7 CONCLUSION Page 41 APPENDICES APPENDIX B Page 45 Page 46 Page 50 ire APPENDIX C Page 44 sh APPENDIX A Page 43 rd tfo BIBLIOGRAPHY er REFERENCES fH 6. Page 71 Page 6 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report LIST OF FIGURES Figure 0 Project Time plan Un Figure 1 Screen shot of newsgator news aggregator Figure 2 RSS specification http://blogs.law.harvard.edu/tech/rss Figure 3 RSS specification http://blogs.law.harvard.edu/tech/rss ive Figure 4 Screen shot of part of homepage Figure 5 Code extract of RSS feed Figure 6 Code extract Edit RSS feed t rsi Figure 7 Screen shot edit RSS feed Figure 8 Code extract Edit style sheet Figure 9 Code session variable checks yO Figure 10 Screen shot search Figure 11 Code for search feeds file Figure 12 testing results ire sh rd tfo er fH Page 7 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report GLOSSARY RSS: Really simple syndication Un XML: extensible mark-up language ASP: Active Server Pages VB: Visual Basic ive CSS Cascading Style Sheets XSL Extensible Style sheet Language ire sh rd tfo er fH yO t rsi Page 8 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 1. Introduction RSS news feeds are a way of syndicating information. People can subscribe to RSS Un feeds using a news aggregator. This project aims to explore RSS feed technologies and applications. On completion of the project we aim to show a full deep understanding of how the technology works and how it can be implemented. ive RSS is becoming a very important medium for syndicating content across the internet. Anybody who is involved with managing or providing content for a website would t rsi find this report an invaluable insight into RSS. 1.1 Project Aims yO To produce a simplified news aggregator website using a variety of languages (HTML /Java Script / XML/ RSS /PHP) to display the use and flexibility of RSS feeds. fH The site will illustrate one of the versatile features of RSS feeds by having its own feeds as well as some pulled from other websites (third party feeds). er Site deign needs to be clear and easy to use; the users should be able to find the RSS feed they want and easily subscribe, a user friendly interface is essential for this. rd tfo There will be an admin console (content management system) for the site so that RSS feeds can be edited and updated without programming knowledge 1.2 Objectives sh § Create user friendly site § Create and display fully functional RSS feeds consisting of own and third ire partnership RSS feeds. § Own feed to be able to syndicate to. § Create admin consol that will give administrators the ability edit RSS feeds that it owns securely and easily without prior knowledge of coding. § Creation of search engine facility to search predefined feeds for keywords of interest. . Page 9 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 1.3 Constraints In order to complete this project successfully the project must fall within certain Un constraints. The primary restraint for this project is to stay in the subject area relevant to the given project title “RSS based news feeds for information gathering” and to ive stick to using technology that is supported by the University of Hertfordshire and that can be demonstrated on university servers. Financially there is no budget allocated for the project work so the project must work t rsi with equipment, software and facilities available within the university laboratories. The project has a strict submission date and this must be adhered to in order to complete the project. yO 2. Feasibility study fH In order to complete the project successfully we must look objectively at what is required to complete the project and see if it is possible within budget, in time and is physically possibly with resources available. rd tfo § er 2.1 Technical Challenges To implement the project aims and objectives using the variety of languages HTML / XHTML, XML / XML Namespaces/ASP/JavaScript. To obtain and use feeds from third party sites and use them on the project site. § To produce a RSS feed using XML adhering to the RSS specification that users can syndicate too. ire sh § Many different standards and variations for RSS have been developed. They mostly contain the same core elements. As many developments had very similar schema they did not take off. RSSv2.0 is the most up to date versions that is taking off. The project is going to use the RSS v2.0 standard (RSS 0.91 and RSS 1.0 were considered and rejected due to there complicity). Page 10 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report There may be conflicts with using RSSv2.0 with very old news readers if they have not been updated.. § Creation of a secure administrator consol to easily update RSS feed without prior knowledge of coding. Un § To make the site cross platform (Windows95/98/NT/2000/XP, Macintosh, Linux) and cross browser compatible (IE, Mozilla Firefox, Flock, Netscape & ive Opera). 2.2 Foreseen issues t rsi The most changeling issues expected to arise during the project are to be directly related to the technical complexity of the ambitious project aims. Creating RSS feeds yO to be subscribed to by news Readers\Aggregators will be the first hurdle to overcome and will form the basis of the project. The content management system and search facilities will pose the greatest challenge. fH They will need to be user friendly as they are intended to be used by users with no programming background. Due to the strict time constraints functionality will be paramount over user friendliness. With adequate research all issues that arise should rd tfo 2.3 Resources analysis er be surmountable within the time allocated To complete the project very little in the form of specialist equipment will be required. An IBM compatible PC that is capable of writing code in text pad with a sh version of a browser that supports RSS/XML which is connected to the internet will suffice for the majority of work to be carried out. Graphic design will require more ire sophisticated software such as Photoshop. During testing stages multiple machines with different operating system platforms supporting multiple browsers will be required. Availability of all resources mentioned can be obtained through the LRC and labs at university. Cost is a factor that has been considered. This project will incur no costs; all resources are already available through the university free of charge. Page 11 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 2.4 Risk assessment This project is a computer coding project and as so contains very little risk attached Un with it. Due to the nature of the project there is no need to conduct thorough and definitive risk and ethically assessment as there is no foreseeable risk in either ive department. The only minor risk is that a breach copyright happens with certain RSS feeds and extensive research into copyright issues should avoid any issue. During the course of the project if dangerous situation arose advisement would be t rsi sought immediately. No such situation can be foreseen. 2.5 Stages of work: yO Literature research Research into similar projects that have been conducted. Conduct background Coding research er fH research into RSS specifications it origins and potential. Research into relevant coding that will enable the site to complete the functionality of the project aims. Need to understand the relationship between rd tfo XML and RSS and how we can combine technologies fulfilling aims and objectives set out for the project. Initial design of site sh Initial design ideas for the site. Design need to meet aims and be functional as well as user friendly. Very important that the user can easily see and subscribe Final design ire to the RSS feeds Modify design where necessary to better meet aims of project. Page 12 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Implementation § Build the basic shell of site to add elements to. § Create own RSS feeds to be able to be syndicated to. § Making third party RSS feeds work on site shell. Un § Design and implementation of content management system for own RSS feeds. To include a secure logon for editing feed without knowledge of § ive programming. Creation of a search facility to search through pre defined RSS feeds and display relevant results. Robust testing and error correction of core functionality of site before t rsi § developing further. Make all user interfaces appealing (graphics, fonts, colours, buttons etc). § Testing on end users if time permits § N.B if time permits may look into expanding functionality of site (blogging?) § Site ready for launch,(coding and design complete) Project report fH yO § Report denoting the technical work involved in the project ire sh rd tfo er Page 13 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 2.6 Time plan Anticipated time to be spent on each area of project; ire sh rd tfo er fH yO t rsi ive Un Figure 0 Page 14 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 3. Research 3.1 History of RSS Un RSS stands for “really simply syndication” it can sometimes be referred to as Rich Site Summary or a few other variants but “really simply syndication” is generally ive accepted. It is a way of distributing or syndicating content. You can display information on a web page that people can subscribe to and view through a news aggregator or similar t rsi device. RSS was originally developed by Netscape around 1997 but was dropped by the company for a variety of reasons. It was then championed by various other groups and yO many versions and standards were released. Today we have the most up to date standard of Version 2.0 which is now the standard used across the board. fH 3.2 Uses and example of RSS er RSS feeds can be used as content for your site as well as third party sites and provide a method by which you can syndicate information. rd tfo When information is updated on any RSS feed the content will automatically update for any one syndicating to the feed, thus giving people using the feed on there own sites dynamic content and allows the author of the feed to deliver there updated feeds seamlessly to all who are syndicated to. RSS based news feeds are empowering users and delivering content where and when sh they require it. RSS News feeds are providing an increasing important role as a delivery medium for people to distribute information in our overloaded information ire society. Page 15 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report A popular RSS feed would be news based one, below is an example of how a feed may look in a news aggregator er fH yO t rsi ive Un Figure 1 Above in figure 1 shows a popular news aggregator “newsgator online” on the left rd tfo hand side you have the Feeds that you are subscribed to and on the right you have the contents of the feed. So in the example above it is showing the contents of the BBC News feed. The feed shows a news headline and a brief description. On browsing the news items if there is one that user would like more information on the user simply instance. ire sh clicks on it and it would link to the story in full on the BBC news website in this Page 16 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 3.3 Technologies behind RSS Un RSS feeds are written in XML code and follow a strict specification in order for the code to be correctly interrupted by aggregators. ive The principle for RSS specification version 2 are that you define a channel which must contain at least the below elements t rsi Element Description Example title The name of the channel. It's GoUpstate.com News Headlines yO how people refer to your service. If you have an HTML website that contains the same fH information as your RSS file, the title of your channel should be the same as the title of your The URL to the HTML website corresponding to the channel. description Phrase or sentence describing the channel. http://www.goupstate.com/ rd tfo link er website. The latest news from GoUpstate.com, a Spartanburg Figure 2 reference [1] http://blogs.law.harvard.edu/tech/rss ire sh Herald-Journal Web site. A channel can contain any number of <items> that the author deems necessary. All elements of an item are optional, however at least one of <title> or <description> must be present. Below are commonly used elements for <items> normally all feeds will contain these three as a minimum. Page 17 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Element Description Example title The title of the item. Venice Film Festival Tries to Quit Sinking Un link The URL of the item. http://nytimes.com/2004/12/07FEST.html description The item synopsis. Some of the most heated chatter at the ive Venice Film Festival this week was about the way that the arrival of the stars at the t rsi Palazzo del Cinema was being staged. Figure 3 reference [1] http://blogs.law.harvard.edu/tech/rss yO 3.4 summary and future of RSS Due to our overloaded information society and with the amounts of unsolicited junk fH mail we receive the future of RSS looks positive and in some form it will provide a block in our future communication systems. This is due to the nature of the format, you subscribe to it, it is content that you want and require. Users have the ability to er read at a glance the information available and make a quick decision on whether you rd tfo wish to consume or discard. RSS gives everybody the ability to make there content widely availably to an audience. It is especially useful for content that is constantly updating like news headline feeds. Up to date information is a valuable commodity for business it makes RSS highly desirable by companies who wish to distribute constantly changing sh content to other business or users. The technology has huge potential and is growing at a fast rate. By using RSS, ire information on the web becomes easier to find and more relevant to the user. Future RSS versions will include additional fields that will make it even easier to categorize and share. There are some views say that RSS will only evolve into a corporate communication channel. Others claim that it will change the way we use the internet and help reduce the problems of Spam and give users the content they want when they want it. Page 18 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report The conservatives say that the middle ground is probably where it will end up. Time will inevitable tell. Un 4. Design & Implementation The report has so far outlined aims and objectives as well as background research for ive me project. The following section will outline the work carried out in fulfilling the aims and objectives of the report. t rsi 4.1 Homepage yO As the project is mainly about functionality and showing functionality and versatility of RSS a simple effective design for the general layout was produced. The homepage has a simple navigation of six block buttons with neutral look which lead to the relevant areas for demonstration. The six buttons used where chosen as fH they were best to clearly show the elements of the project. ire sh rd tfo er Figure 4 Figure 4 is a screen shot of the final design of the buttons on the home page. Each button leads to a new page. The first two buttons give a brief outline of the project aims and objectives via the “Project Outline” button. The “What is RSS?” button gives the user an insight into the functionality of what RSS is, similar to what has been outline in previous chapters of this report. All the information is provided by text based pages with some graphical presentation. These pages were not part of the main Page 19 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report aims and objectives of the project but do enable anyone just looking at the application to get a better insight into the project and it functionality. 4.2 Own RSS Feed Un The creation of own RSS feeds forms a fundamental part of the project. First ive consideration when designing the feed was to look at the standards of RSS available and to decide which would be most appropriate to fulfil aims and objectives of project. RSS version 2.0 was decided would be most suitable as it is the most t rsi prevalent standard being used at present. Next major design consideration is to decide which elements of the RSS schema to use for the feed. Chapter 3.3 shows some elements that can be used in the feed. yO Deciding on which elements to include in the design is for mostly dictated by the data that you are trying represent in the feed. As the content for the feed in the project is irrelevant and is not targeted towards any particular audience the elements chosen fH where done so on the basis of showing a broad and popular range of what is available in popular feeds at moment in order to best show functionality of RSS. Channel elements rd tfo er Structure of elements used in feed: Elements Description <title> Title of channel of rss feeds. It's a refers to your feeds as a colective. <description> Description of channel <language> Language used in feed <copyright> Intellectual copyright owner <webMaster> Web master for issues regarding feed ire Link to where channel and feeds exist sh <link> Item elements Elements Description <title> Title of individual item of RSS feeds. Page 20 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire <link> Link to where item/story exists <description> Description of item <author> Author of story BSc./BEng. Final Year Project Report Un Coding of Own Feed RSS feeds follow a certain specification on order that they can be deciphered by news ive aggregators and alike however the document is an XML document so must adhere to rules that make it a valid XML file. In order to achieve this it must be defined as an XML document and follow XML t rsi specification where all tags that are opened must be closed. Below is the code for the feed with notation where appropriate. XML declaration yO Style sheet for xml file Channel fH Information rd tfo er Item Information ire sh Page 21 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Figure 5 This XML document which conforms to RSS specification is the completed coding for the feed. On making the xml file live on a web server with an available URL you can start syndicating content. News aggregators read the XML file and present the Un data to there user in a consumable format. Any changes made to this file would automatically be updated to all who are syndicating. ive With the annotation above in figure 5 you can see that in the xml file there is a style sheet that is associated to it. XML files contain no formatting within them, they are t rsi purely data. Data structure and element naming is very logical in XML however if the feed was viewed in a compatible browser with out a style sheet there would just be the XML file in its raw contents (document tree). A style sheet contains formatting yO instructions that a browser uses to present the data in the XML file in a more user friendly format. This is a separate file form the XML file and is linked to the xml file with; fH <?xml-stylesheet title="XSL_formatting" type="text/xsl" href="styleFormat.xsl"?> er This line states that there is a style sheet called styleFormat.xsl associated with this file. Using a style sheet the feed can be displayed on our web site in a user friendly rd tfo readable format. Below are extracts of code form the style sheet. Full code can be found in appendix please refer to coding section in appendix. sh This snippet of code shows the start of the XSL style sheet, its starts with an XML ire deceleration statement The style sheet had a link to http://www.w3.org that is an industry body that hold specifications for XSL, XSLT and similar standards. Page 22 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report XSL is an extremely powerful and when combined with x path can manipulate data in XML documents in many ways. Below a selection of relevant parts form the style sheet file displayed with annotation. Un Statement is selecting all “item” that are a child of ive “channel” t rsi Value-of-select is selecting yO individual data from an <item> in this case <link> is being selected and as we want to represent this to the user as a hyperlink the <a converts the data from link into a hyperlink when displayed in the er fH href=”{link}”> is used this browser. ire sh rd tfo Page 23 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 4.3 Edit RSS Own Feed When designing the system for editing feed there were two main approaches considered. Un Database driven with ASP approach ive The database approach would have a database that holds the feed information. The feed would pull its information from the database. Administrators would update the database when making changes to edit feed. This has complications due to the fact t rsi that the page would only be updated when you requested the data from the database. This would happen when you executed the page so not until then would you have up to date content. News aggregators only read they file for its contents they don’t yO actually execute any file. This approach could have been rectified by writing a new feed from the database overwriting the existing feed. This method is extremely complicated and was rejected ASP and XSLT approach er fH due to its complex nature when trying to design code for this approach. This approach edits the file directly. Using ASP and a XSL style sheet the RSS XML file is loaded into an editable table in a web browser. Now that the data is in memory rd tfo it can be manipulated as required. Using ASP and XPath expression the XML file cane be updated with the submitted values. This way the data is update immediately and next time a news aggregator checks the feed it will see that its contents has changed and it will notify the user. sh This approach was adopted for the project as it meets the needs and could be achieved ire in the timescale. Page 24 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Below a detailed look at coding required for this section; The process in block form is as follows Un Check to see if Transform xml feed with style user is logged sheet loading values into memory ive in Submit changes to file t rsi Link data in array memory to data updating locations in file yO Iterate over xml file Save XML Release all object Load edited feed references with a style sheet fH file to show changes er Refer to coding section of appendix for full code rd tfo Code is annotated in with green comments and call out boxes to the right of the code on next page; ire sh Page 25 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Verify that the user is logged ive Un in. covered in Check to see if submit t rsi button has been pressed, if not transform fH yO Loading er XML file sh rd tfo Figure 6 Output ire transformed document to Page 26 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Un This section is where the feed is actually updated, where it takes information form the post array in ive Variables declared er fH yO t rsi Figure 6 rd tfo A major problem that occurred during the coding stage of the ASP update feed file was that, RSS file had conflicting element names. In the <channel> and <item> elements there children had the some of the same element names. This sh causes issues when trying to write inputted data back to file as it could not distinguish between the <description> child of <channel> and the <description> ire child of <item>. Resolution to this problem was found when we gave the <item> and <channel> a unique identifier. We gave it this by adding names into the style sheet which could be deciphered here i.e. if fist 2 letters = “it” it’s a item if = “ch” it’s a channel. This resolved issue between <channel> & <item> however a new problem arose as there are multiple <item>. A way of distinguishing them in the array was necessary so a counter was used. This was the simplest way to uniquely identify each <item>. Page 27 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Continuing Un identifying elements yO t rsi ive fH Save XML file Release objects so er memory resources rd tfo Figure 6 not to use up Load up edited file for Administrator ire sh Screen shot of the Edit RSS page you can see that editable data is in input boxes Figure 7 Page 28 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 4.3.1 Style sheet for edit feed Mentioned above the ASP code used a style sheet in order to present the data in the feed in an editable fashion. Below are extracts of the file. Refer to coding Appendix Un for full code. ive The two extracts of code show a section that was used to display part of the <channel> and part of one of the <item>. Giving the name a unique t rsi identifier “chtitle” as mentioned in ASP code above fH yO element of the <channel> to display its value rd tfo er Figure 8 Selecting the <title> Giving the name a unique identifier “ittitle” as mentioned in ASP code above ire sh Counter to differentiate from other <item> Page 29 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 4.3.2 Login to Administrator area Although project is primarily concerned with functionality some security restrictions were implemented when logging in to the Administrator area to edit the feed. This Un would make the project more relevant when compared to real world applications. Complex security user logins could be a project in its self, due to this two simple ive options were considered; Database approach t rsi Create a database holding user account information in and query the database using ASP to see if the data inputted on the log in page matches the information held on the database, if so set an active session variable and direct the user to the appropriate yO page, if user information does not match direct to failed login page. Text based fH Create a text document holding user account information (username & password only) in and query the text file using ASP to see if the data inputted on the log in page matches the information held in the text file, if so set an active session variable and er direct the user to the appropriate page, if user information does not match direct to failed login page. rd tfo Both approaches would suffice for the project. Text based approach was used due to time constraints it was deemed as the less time consuming to implement. sh This section of code is in every secure page. The code checks to see that the session variable is true. The session variable is left at its default. If it is not true on any ire restricted page then the user is redirect back to login page. Figure 9 Page 30 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Full code for login page can be found in coding part of Appendix The login method provides an effective simple way of restricting users from certain areas of site. This design would not be appropriate if data was of a sensitive nature. Un 4.4 Third Party Feed ive The main decision when implementing the third party feed in the project was to decide which feed to use that would show the greatest versatility of RSS. After t rsi looking at many areas of feeds News broadcast feeds were considered to be most reflective of feeds being used at the moment. BBC News Feed provided a perfect solution. The feed was reliable, constantly updated and had a large selection of items yO to choose form. BBC also gave open licence to anyone to use there feed on there site as long as data was not represent as being anything apart from BBC owned. fH Displaying the feed on the project site was done via JavaScript. Many sites that offer the use of their feeds often provide the code that you need to add to your website. With the BBC this is not the case you can format it as you whish to. As most sites er show other peoples feeds using JavaScript a utility was used from website called http://p3k.org/rss/?setup=true (reference [2]) to create the JavaScript to link to the rd tfo BBC Feed. This part of the project is very important it shows an important reason as to why RSS is taking off. It is a perfect way for sites to add dynamic content at no cost to there 4.5 Search Function ire sh site which could lead into higher traffic flow for site. Creating a search facility is a complex task. The subject matter being difficult, decisions on approaching the design of the search facility were vast. Page 31 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Due to time constraints aspects of the design were determined because of that constraint. The search would have to be from a predefined list of feeds. Not an automatically generated and up dating list similar to Google and large search engines. Un The list must be predefined and small to manage in order to make it possible to create a working search function for the project site. ive Next design consideration is how the data of the feeds are going to be stored, locally or remotely and in what format are key considerations. t rsi Remotely would be harder to search due the fact that the data is remote and you would have to rely on internet connection. Creating a programme to search an external file could be problematic for this reason yO . Locally is a preferred method for this project but has its own issues associated with it. Performing the search locally is the most viable option but designing a system that fH will work is complex. Firstly a method must be devised of copying the feeds locally in order to search them er locally. Initially the design just catered for copying the feeds over once and not updating them. This is not sufficient as one of the main features of RSS is that the rd tfo data is constantly updated. Design for capturing the feeds to be searched locally is to have predefined list of feeds to be search contained in an xml file as shown below ire sh Feed details Name URL location File Name Page 32 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Using ASP the data in the xml file containing the URL of the feed is loaded. This URL is the accessed to find the feed file. The file contents is copied back to local memory and saved as an xml file locally. Un Below is relevant section of code with green annotation yO t rsi ive fH Requesting web page with “GET” command. rd tfo er Setting permission for file to be saved so that it can be overwritten when needs be sh automatically. captured and updated successfully. ire Show user that the files have been N.B Full source code can be obtained from the code section of the Appendix Page 33 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report In order to make the data accurate and up to date, before performing a search an option is given to the user to update the feeds; if this is done it will run through procedure outlined above but will overwrite the existing file automatically , this way the user will always have the most up to date information to search. t rsi ive Un Screen shot showing option for searchable feed yO Screen shot of update Figure 10 confirmation that feeds updated successfully fH Next design consideration is how to search the up to date feeds that are stored locally and display results to user. Code could be designed to search how commercial search er engines work accepting multiple key words and performing special functions if certain characters are used or putting more emphasis on words that begin with capital rd tfo letters etc. However this would be a project in its self. The most realistic method of implementation would be to search for a single keyword. Research shows the best method for this project within time constraints is to perform sh a search on the whole feed by loading the whole feed into memory and search for keyword entered by user. If keyword is present then return a positive result. This information which would influence search results. ire method is a simple searching method and does not take into account ambiguous Page 34 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Below are extracts of relevant code from the searching pages. Full code can be viewed form the code section of the Appendix. Un Loading feeds.xml that contains file name and ive location of feeds to be searched t rsi Selecting relevant part of xml document that Figure 11 yO contains the name of the feed i.e. bbcPolitics.xml rd tfo er fH Actually performing the Wright response back to user inputted keyword in the sh showing results found search, looking for the string showing where to enter ire Screen shots Page 35 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 4.6 Site/Project Navigation Diagram This diagram shows how the Project website page are connected up form the homepage down. ire sh rd tfo er fH yO t rsi ive Un Page 36 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 5.0 Testing Un The project will be tested on these two main objectives to see if they have been achieved. ive Functionality of site Does everything designed and implemented work as imagined? t rsi Does it show clear uses and functionality of RSS? Is a user more enlightened about RSS and understand how RSS can be implemented after viewing the project? yO The project under went on going testing and evaluation throughout the project as each section of code was written it would be tested and refined as it was being coded. er fH 5.1 Testing methodology rd tfo It was planned to conduct testing on a user group of 20 people to test the two testing objectives set out above. Issues arising with the coding stages of the project being more complex than originally anticipated, time remaining were not enough to test and evaluate such a large user group of people. Due to these unforeseen issues testing at the end of the project was used to help evaluate aims and objectives met and give sh thought to future developments rather than giving emphasis on testing and implementing changes as time did not allow for this approach. ire A focus group of 5 people were used to test the project. Each participant was briefed about the project aims and was given 15miniutes to explore the project on a computer and where asked to rate if they thought project aims were met. Each user completed the test one at a time this enabled observational testing to be carried out, noting any issues that were obvious that the user may overlook. Page 37 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report After each user had conducted there individual element of the test the focus group convened and had an open discussion about the project. Un 5.2 Testing results ive Below is a summary of findings, full results can be found in appendix Did project meet aims outlined? t rsi Participant Rating of aims achieved Excellent Participant 2 Participant 3 Participant 5 Bad er Figure 12 Fair fH Participant 4 Average yO Participant 1 Good comments. rd tfo Comments and notes from observational test, user individual feedback and group “Did not know what RSS was now I have an understanding of the subject and can see that it is a useful technology and could see it being used more and more in years to ire sh come” “Site presentation could have been better, parts of site could do with better formatting to be more appealing to the eye, but the project does function as indented” “Project seemed to meet aims set out “ Page 38 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report “project met aims however would have expect to see more from the content management system, the ability to add new feeds as well as editing them would have been nice” Un “Overall a good project” ive Observational point Users seemed not to like to have to update feeds before searching. Would have t rsi preferred to not to have to do that. Automating it so when you open the search page it automatically updates feeds would be preferred. ire sh rd tfo er fH yO Page 39 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 6.0 Future Developments This section encompasses elements form results and feedback form testing as well as Un general areas that the project could be developed in future. The testing of the project shows that users were happy with the functionality of the ive project but wished that it was more user-friendly and aesthetically pleasing. This could be achieved by conducting greater research and consulting with more users. This would help indicate user requirements that wish to be seen in the site, which t rsi would help developed a more user-friendly environment. At present the content management area of the site only has one function to edit feeds. yO This could be expanded to give administrators greater flexibility. Functions such as add feeds and delete feeds would give the application much more versatility and would be closer to really life news aggregator systems. fH If the project was to be developed into a business application the area of security er would need to be expanded on significantly. The administrative areas in particular would need a stringent security policy maybe encompassing encryption, sophisticated rd tfo session variables and user profiles. The search feature could be redesigned to automatically update feeds at predefined times. The search method could be adapted to be more accurate. Options to search just feed name or description could be used to produce more accurate results to the user. sh This area of search is an extensive area and almost endless expansion options. ire Bloggs would be an exciting expansion area for the project. Bloggs are common place now and many news aggregators offer there users the ability to create and run there own blogg, this would logically be a good expansion area for the project. Page 40 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report 7.0 Conclusion The purpose of this project was to explore and demonstrate RSS based news feeds for Un information gathering. The project creates a feed, uses third party feeds, provides a secure administrative area to edit feed without programming knowledge, provides a search function and explains what RSS is. The end of the project has resulted in a ive system that fulfils the objectives set out at the start. Primary Objectives t rsi Creation of a user friendly site yO Users can easily navigate around the site. This objective as highlighted in the testing stage could be improved. Due to coding stage of project taking longer than anticipated user friendliness was demoted in importance for functionality. fH Create and display fully functional RSS feeds consisting of own and third partnership RSS feeds. BBC news. rd tfo er Users can view RSS feed that the project produced as well as viewing a feed form the All RSS feeds should be able to be syndicated to with any news aggregator. Users can syndicate to the feed created using any news aggregator and will perform the same as any other feed that users subscribe to in there news aggregators. sh Create an admin consol which will give administrators the ability to add knowledge of coding. ire and edit RSS feeds that it owns securely and easily without prior Administrators can login to a secured page and edit the feed created through a web interface and submitted changes and the feed will be automatically updated. This requires no knowledge of programming, data to be edited is presented in a simple form format to be edited. Page 41 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Creation of search engine facility to search predefined feeds for keywords of interest. . Users can search through a list of three feeds for any keyword they require. The feed Un will be searched and results will be submitted to the user, if a match is found the relevant matches will be show with a hyperlink to direct the user to the feed. ive Time management through the project proved problematic and amendments were needed to the original time plan. (Refer to appendix for copies for before and after t rsi time). These amendments were due to the coding stages of the project taking longer than anticipated. Calculating time needed was difficult as having no previous experience of this type of coding to refer to. Due to these factors the testing of the yO project was not as thorough as it initially aimed to be. To conclude the primary objectives and aims for the project where met. Time fH planning had to be adapted to compensate for coding complications. This project clearly shows the versatility of RSS by implementing it in various ways and er technologies through the project. RSS is growing in use day by day and this project highlights the main reasons as to the exceptional growth of this technology. ire sh rd tfo Page 42 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report REFERENCES Un [1] Unknown Author http://www.rss-specifications.com/history-rss.htm October 10 2005 RSS specifications ive [2] Unknown Author t rsi http://p3k.org/rss/?setup=true October 11 2005 JavaScript creation tool ire sh rd tfo er fH yO Page 43 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report BIBLIOGRAPHY Literature resources Un Title: XML programming : Web applications and Web services with JSP and ASP Author: Alexander Nakhimovsky, Tom Myers. ive Title: No nonsense XML web development with PHP Author: Thomas Myer. t rsi Title: Programming the World Wide Web Author: Robert W. Sebesta. yO Title: Internet architectures Author: Aniel Minoli, Andy Schmidt. Author: Steven Holzner. Online Resources http://www.w3schools.com rd tfo er fH Title: Real world XML Coding technology information sh Online encyclopaedia http://www.webtechsig.org/Presentations/rss/rss- HAL-PC Web Technologies SIG links.htm ire http://www.wikipedia.ord http://www.msdn.microsoft.com Microsoft Developer Network http://www.w3.ord World Wide Web Consortium Page 44 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire http://www.faganfinder.com/search/rss.shtml BSc./BEng. Final Year Project Report RSS & atom feeds information ire sh rd tfo er fH yO t rsi ive Un Page 45 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report APPENDICES Un Appendix A Test Results ive Project Time Plans t rsi Appendix B Important parts of Project Code (Refer to attached CD for full project Code) yO Appendix C Selection of screen shots of project ire sh rd tfo er fH Page 46 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Appendix A ire sh rd tfo er fH yO t rsi ive Un Page 47 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Testing results Aims outlined to participants Un To produce a simplified news aggregator website using a variety of languages (HTML /Java Script / XML/ RSS /PHP) to display the use and flexibility of RSS feeds. ive The site will illustrate one of the versatile features of RSS feeds by having its own feeds as well as some pulled from other websites (third party feeds). The site will give t rsi users the chance to select from a range of RSS feeds to meet there needs. The site needs to be clear and easy to use; the users should be able to find the RSS feed they want and easily subscribe, a user friendly interface is essential for this. yO There will be an admin console (content management system) for the site so that RSS feeds can be edited and updated without programming knowledge Participant Rating of aims achieved Participant 3 Participant 4 Participant 5 Average Fair Bad sh rd tfo Participant 2 Good er Excellent Participant 1 fH Results as to how they rated the aims being achieved comments. ire Comments and notes from observational test, user individual feedback and group “Did not know what RSS was now I have a understanding of the subject and can see that it is a useful technology and could see it being used more and more in years to come” Page 48 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report “like the graphics used” “Site presentation could have been better, parts of site could do with better formatting to be more appealing to the eye, but the project does function as indented” Un “did not realise you could use RSS as site content on your own site, interesting point” “Project seemed to meet aims set out “ ive “project met aims however would have expect to see more from the content management system, the ability to add new feeds as well as editing them would have t rsi been nice” “Overall a good project” yO “project shows the functionality of RSS but would need to be adapted if it was to be real life commercial application” fH Observational point Users seemed not to like to have to update feeds before searching. Would have er preferred to not to have to do that. Automating it so when you open the search page it automatically updates feeds would be preferred. rd tfo Users looking for navigation on the left hand side of the screen ire sh Page 49 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Project Time Plans ire sh rd tfo er fH yO t rsi ive Un Page 50 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Appendix B ire sh rd tfo er fH yO t rsi ive Un Page 51 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Project feed xml file <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet title="XSL_formatting" type="text/xsl" href="styleFormat.xsl"?> Un <rss version="2.0"> <channel> <title>FYP News Feed</title> ive <link>http://mmtprojects4.mmt.herts.ac.uk/year4/MMT439/public/rss.xml</link> t rsi <description>FYP Project based on RSS News Feeds</description> <language>English</language> <copyright>Tim Coup</copyright> yO <webMaster>Tim Coup</webMaster> <item> <title>News story to show that Edit RSS works 1</title> fH <link>http://mmtprojects4.mmt.herts.ac.uk/year4/MMT439/public/rss1.htm</link> <description>FYP Project can edit rss feeds as well as search er feeds 1</description> <author>Tim</author> <item> rd tfo </item> <title>News story to show that Edit RSS works 2</title> <link>http://mmtprojects4.mmt.herts.ac.uk/year4/MMT4- sh 39/public/rss2.htm</link> <description>FYP Project can edit rss feeds as well as search <author>Tim</author> </item> ire feeds 2</description> <item> <title>News story to show that Edit RSS works 3</title> <link>http://mmtprojects4.mmt.herts.ac.uk/year4/MMT439/public/rss3.htm</link> Page 52 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report <description>FYP Project can edit rss feeds as well as search feeds 3</description> <author>Tim</author> </item> Un <item> <title>News story to show that Edit RSS works 4</title> <link>http://mmtprojects4.mmt.herts.ac.uk/year4/MMT4- ive 39/public/rss4.htm</link> <description>FYP Project can edit rss feeds as well as search t rsi feeds 4</description> <author>Tim</author> </item> yO <item> <title>News story to show that Edit RSS works 5</title> <link>http://mmtprojects4.mmt.herts.ac.uk/year4/MMT4- fH 39/public/rss5.htm</link> <description>FYP Project can edit rss feeds as well as search feeds 5</description> </item> </rss> ire sh rd tfo </channel> er <author>Tim</author> Page 53 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Edit feed XML file <% ' is the user logged in? Un if Session("logged_in") <> "true" then ' if not then redirect the user to the login page Response.Redirect ("login.html") ive end if t rsi ' Test to see if the form has been submitted. ' If it has, update the XML file... yO If (Request.Form("btnSubmit") = "") Then loadXMLFile server.MapPath("rss.xml"), server.MapPath("editFeed.xsl") fH ' ...if not, transform the XML file for editing. Else End If ' ' loadXMLFile() sh ' rd tfo er updateXML server.MapPath("rss.xml") ' Loads an XML file, and displays it using the XSL transform provided. ire ' ' strXMLFile The path and file name of the XML file. ' strXSLFile The path and file name of the XSL file. ' Function loadXMLFile(strXMLFile, strXSLFile) Dim objXML Dim objXSL Page 54 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report ' Create and load the XML file into an XMLDOM object. Set objXML = Server.CreateObject("Microsoft.XMLDOM") objXML.async = false Un objXML.load(strXMLFile) ' Create and load the XSL file into an XMLDOM object. ive Set objXSL = Server.CreateObject("Microsoft.XMLDOM") objXSL.async = false t rsi objXSL.load(strXSLFile) ' Transform the content of the XML document using our stylesheet, yO ' the output the new document to the client. Response.Write(objXML.transformNode(objXSL)) End Function er ' updateXML() fH ' ' ' ' strXMLFile The path and file name of the XML file. ' Dim objField ire Dim objRoot sh Function updateXML(strXMLFile) Dim objDom rd tfo ' Updates the XML file with information from the POST array. Dim objTemp Dim intI ' Create and load the XML file into an XMLDOM object. Page 55 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Set objDom = Server.CreateObject("Microsoft.XMLDOM") objDom.async = false objDom.load(strXMLFile) Un ' Get a refernce to the root node in the XML file. Set objRoot = objDom.DocumentElement ive ' Iterate over the POST array, updating the XML file with the submitted values. t rsi For intI = 1 to Request.Form.Count intID = 0 strNodeName = "" yO ' Grab the current key and value from the POST array. strKey = Request.Form.Key(intI) fH strValue = Request.Form.Item(intI) ' If the key starts with "ch", it is a channel value. er If (Left(strKey, 2) = "ch") Then rd tfo ' Build an XPath to the node, grab a reference to it and update it. strNodeName = "//rss/channel/" & Mid(strKey, 3, Len(strKey)) Set objField = objRoot.selectSingleNode(strNodeName) objField.Text = strValue sh ' If the key starts with "it", it is an item value. strNodeName = "//rss/channel/item/" ire ElseIf (Left(strKey, 2) = "it") Then ' If the key contains "titl" it is a title field, ' separate out the id and complete the node name. If (Mid(strKey, 3, 4) = "titl") Then intID = cint(Right(strKey, Len(strKey) - 7)) Page 56 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report strNodeName = strNodeName & "title" ' If the key contains "link" it is a link field, ' separate out the id and complete the node name. Un ElseIf (Mid(strKey, 3, 4) = "link") Then intID = cint(Right(strKey, Len(strKey) - 6)) strNodeName = strNodeName & "link" ive ' If the key contains "desc" it is a description field, t rsi 'separate out the id and complete the node name. ElseIf (Mid(strKey, 3, 4) = "desc") Then intID = cint(Right(strKey, Len(strKey) - 13)) yO strNodeName = strNodeName & "description" ' If the key contains "auth" it is a author field, fH 'separate out the id and complete the node name. ElseIf (Mid(strKey, 3, 4) = "auth") Then intID = cint(Right(strKey, Len(strKey) - 8)) End If rd tfo er strNodeName = strNodeName & "author" ' Get a reference to the node and update it's value. Set objField = objRoot.selectNodes(strNodeName).Item(intID - 1) End If ' Save the XML file. ire Next sh objField.Text = strValue objDom.save strXMLFile ' Release all of our object references. Set objDom = Nothing Page 57 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Set objRoot = Nothing Set objField = Nothing ' Use loadXMLFile() to show the newly updated XML file. Un loadXMLFile strXMLFile, server.MapPath("displayFeed.xsl") End Function ive %> t rsi Edit feed style sheet <?xml version="1.0"?> yO <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" exclude-result-prefixes="xlink"> <xsl:template match="/"> <body> fH <html> <form method="post" action="editFeed.asp"> er <h1>Edit RSS Feeds:</h1> <table border="0" cellpadding="0"> rd tfo <tr> <td><b>Channel Information</b></td> </tr> <tr> sh <td>Channel Title <input type="text" name="chtitle" style="width:250;"> ire <xsl:attribute name="value"> <xsl:value-of select="rss/channel/title" /> </xsl:attribute> </input> </td> </tr> <tr> Page 58 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report <td>Channel Link <input type="text" name="chlink" style="width:250;"> <xsl:attribute name="value"> <xsl:value-of select="rss/channel/link" /> Un </xsl:attribute> </input> </td> ive </tr> <tr> t rsi <td>Channel Description <input type="text" name="chdescription" style="width:400;"> <xsl:attribute name="value"> yO <xsl:value-of select="rss/channel/description" /> </xsl:attribute> </input> fH </td> </tr> <tr> er <td>Channel Language <input type="text" name="chlanguage" style="width:100;"> rd tfo <xsl:attribute name="value"> <xsl:value-of select="rss/channel/language" /> </xsl:attribute> </input> </tr> ire <tr> sh </td> <td>Channel Copyright <input type="text" name="chcopyright" style="width:100;"> <xsl:attribute name="value"> <xsl:value-of select="rss/channel/copyright" /> </xsl:attribute> </input> Page 59 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report </td> </tr> <tr> <td>Channel WebMaster Un <input type="text" name="chwebMaster" style="width:100;"> <xsl:attribute name="value"> <xsl:value-of select="rss/channel/webMaster" /> ive </xsl:attribute> </input> t rsi </td> </tr> <tr> yO <td><b>News Items</b></td> </tr> <xsl:for-each select="rss/channel/item"> fH <tr> <td>Title <input type="text" style="width:100%;"> er <xsl:attribute name="name">ittitle<xsl:value-of select="position()" <xsl:attribute name="value"> ire </xsl:attribute> sh <xsl:value-of select="title" /> rd tfo /></xsl:attribute> </input> </td> <td>Link <input type="text" style="width:100%;"> Page 60 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report <xsl:attribute name="name">itlink<xsl:value-of select="position()" /></xsl:attribute> Un <xsl:attribute name="value"> <xsl:value-of select="link" /> ive </xsl:attribute> t rsi </input> </td> </tr> yO <tr> <td>Description <input type="text" style="width:100%;"> fH <xsl:attribute name="name">itdescription<xsl:value-of select="position()" /></xsl:attribute> <xsl:value-of select="description" /> </xsl:attribute> rd tfo er <xsl:attribute name="value"> sh </input> </td> ire <td>Author <input type="text" style="width:100%;"> <xsl:attribute name="name">itauthor<xsl:value-of select="position()" /></xsl:attribute> Page 61 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report <xsl:attribute name="value"> <xsl:value-of select="author" /> Un </xsl:attribute> </input> ive </td> </tr> t rsi </xsl:for-each> </table> <input type="submit" id="btnSubmit" name="btnSubmit" value="Submit" /> yO </form> </body> </html> </xsl:stylesheet> <% rd tfo <%@ Language=VBScript %> er Admin login script fH </xsl:template> ' set checking on so that we have to dimension our variables before we can use Option Explicit ire ' dimension our variables first sh them dim fso, tso, line, line_array, c_username, c_password, username, password, found ' What did the user enter? username = Request("username") password = Request("password") Page 62 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report ' are the username and password in our list of valid usernames and passwords? ' Create an instance of the FileSystem object Un Set fso = CreateObject("Scripting.FileSystemObject") ' Open a TextStream object for our list of valid logins ive 'Set tso = fso.OpenTextFile ("users.txt") Set tso = fso.OpenTextFile (server.MapPath("users.txt")) yO t rsi found = false ' Search through the contents of the file do until (tso.AtEndOfStream or found) line = tso.ReadLine fH ' Read a line of the file line_array = Split(line,"|") c_password = line_array(1) rd tfo c_username = line_array(0) er ' Separate the line into username and password ' Do the username and password match what our user entered? ' log the user in Session("logged_in") = "true" end if ire found = true sh if (username = c_username) and (password = c_password) then loop ' Close the text stream tso.Close Page 63 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report ' if we didn't manage to login the user, let them know if not found then %> Un <html> <head> ive <title>Login</title> </head> yO <h1>Login<h1> t rsi <body> <p>Sorry we could not find a match for the information.</p> fH <p><a href="admin_login_page.asp">Try again</a></p> <% else rd tfo </html> er </body> ' if we did log them in, then redirect them to the protected pages %> ire end if sh Response.Redirect ("EditFeed.asp") Third Party Feed code (reference [1]) <!--#include file="header.inc"--> Page 64 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report <div align="justify"> <script language="JavaScript" src="http://jade.mcli.dist.maricopa.edu/feed/feed2js.php?src=http%3A%2F%2Frss.cn Un n.com%2Frss%2Fcnn_topstories.rss&amp;chan=y&amp;num=5&amp;desc=1" type="text/javascript"></script> ive <noscript> <a t rsi href="http://jade.mcli.dist.maricopa.edu/feed/feed2js.php?src=http%3A%2F%2Frss.c nn.com%2Frss%2Fcnn_topstories.rss&amp;chan=y&amp;num=5&amp;desc=1&amp ;html=y">View RSS feed</a> yO </noscript> </div> <p align="center"><b>N.B This is only to show that Webmasters can enhance their fH content by adding third party feeds to their web sites.</b></p> <p align="center"><a href="index.asp">Click here to return to home page </a></p> <!--#include file="footer.inc"--> <!--#include file="header.inc"--> <h1>Update Feeds</h1> <% Dim objFeeds, objXMLHTTP, objFS, objFile Dim strResponse, strFile ire ' declare varables sh <p> rd tfo er Update feeds Dim strFeedFile, strFeedURL, strFilename Dim i, f i=0 Page 65 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report strFile = "" strResponse = "" ' File System XMLHTTP object, ' Declear Doc object Model Un Set objFS = Server.CreateObject("Scripting.FileSystemObject") Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP") Set objFeeds = Server.CreateObject("Microsoft.XMLDOM") ive 'loads feed.xml and select feed using xpath t rsi objFeeds.async = false objFeeds.load(Server.MapPath("feeds.xml")) yO Set objFeeds = objFeeds.DocumentElement.selectNodes("feed") 'resets internal pointer in array objFeeds.reset fH 'points to next node For f = 0 To (objFeeds.length - 1) rd tfo 'mapps dir from nodeobject er Set objNode = objFeeds.nextNode strFeedFile = Server.MapPath("feeds/" & objNode.selectSingleNode("file").text) strFeedURL = objNode.selectSingleNode("url").text objXMLHTTP.Open "GET", strFeedURL, false ire 'request web pages sh strFeedName = objNode.selectSingleNode("name").text objXMLHTTP.SetRequestHeader "Content-type", "text/xml" objXMLHTTP.Send 'data back form request 'blans string file varables Page 66 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report strResponse = objXMLHTTP.ResponseText strFile = "" Un 'filters out characters so it just ASCII code (does not work with out) For i = 1 to Len(strResponse) strFile = strFile & Chr(Asc(Mid(strResponse, i, 1))) ive Next If (objFS.FileExists(strFeedFile)) Then t rsi ' ' objFS.DeleteFile strFeedFile, true ' End If yO 'makes file, over write auto matically 'open text file with permissions 8 fH 'close/save objFS.createTextFile(strFeedFile) Set objFile = objFS.openTextFile(strFeedFile, 8) objFile.close rd tfo 'show been captured er objFile.write strFile Response.write "Captured " & objNode.selectSingleNode("file").text & "<br />" Set objFS = nothing ire 'good pratice to set to nothingno nessary in VB sh Next Set objXMLHTTP = nothing Set objFeeds = nothing Set objFile = nothing strResponse = "" Page 67 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report strFile = "" %> </p> <a href="default.asp">Main Menu</a> ive Un <!--#include file="footer.inc"--> Search Feeds <% t rsi ' Test to see if the form has been submitted. If (Request.Form("btnSubmit") = "") Then yO showSearch Else fH searchFeeds Request.Form("txtSearch") End If ' showSearch() ' ' Shows the search page. ' <h1 align="center">Search Feeds</h1> <form method="post" action="searchFeed.asp"> ire %><!--#include file="header.inc"--> sh Function showSearch() rd tfo er ' <div align="center"> <label for="txtSearch">Search:</label> <input type="text" id="txtSearch" name="txtSearch" /> Page 68 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report <input type="submit" id="btnSubmit" name="btnSubmit" value="Search" /> </div> </form> Un <div align="center"><a href="default.asp">Main Menu</a> </div> <!--#include file="footer.inc"--> ive <% End Function ' searchFeeds() ' yO t rsi ' ' Searches the list of RSS feeds for a value. fH ' Function searchFeeds(strSearch) Dim objFeeds Dim objRoot Dim i Dim intResults sh intResults = 0 rd tfo Dim objNode er Dim objFeed objFeeds.async = false objFeeds.load(server.MapPath("feeds.xml")) ire Set objFeeds = Server.CreateObject("Microsoft.XMLDOM") Set objFeeds = objFeeds.DocumentElement.selectNodes("feed/file") Set objFeed = Server.CreateObject("Microsoft.XMLDOM") objFeed.async = false Page 69 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report %><!--#include file="header.inc"--> <h1>Search Results</h1> <p> Un <% objFeeds.reset ive For i = 0 To (objFeeds.length - 1) Set objNode = objFeeds.nextNode t rsi 'loads into DOM objFeed.load(server.MapPath("feeds/" & objNode.Text)) yO 'checks for errors, just error checking If (objFeed.parseError.errorCode <> 0) Then fH response.write("XML parse error: " & objNode.Text & " - " & objFeed.parseError.reason & "<br />" & vbcrlf) er 'search filed for .text as this way it removes coding characters etc intResults = intResults + 1 rd tfo ElseIf InStr(objFeed.text, strSearch) Then response.write("<a href='displayFeed.asp?feed=feeds/" & objNode.Text & "'>" & objNode.Text & "</a><br />" & vbcrlf) Next ire sh End If response.write("Found " & intResults & " feeds containing '" & strSearch & "'.<br />" & vbcrlf) %> </p> <a href="default.asp">Main Menu</a> <!--#include file="footer.inc"--> Page 70 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report <% End Function %> Un Feed list to be searched XML File ive <?xml version="1.0" encoding="iso-8859-1"?> <timsFeeds version="1.0"> t rsi <feed> <name>BBC News</name> url> yO <url>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml</ <file>bbcNews.xml</file> <feed> fH </feed> <name>BBC Sport</name> er <url>http://newsrss.bbc.co.uk/rss/sportonline_uk_edition/front_page/rss.xml</ <file>bbcSport.xml</file> </feed> <feed> sh <name>BBC Politics</name> rd tfo url> /url> <file>bbcPolitics.xml</file> ire <url>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk_politics/rss.xml< </feed> </timsFeeds> Page 71 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Appendix C Selection of screen shots of project ire sh rd tfo er fH yO t rsi ive Un Page 72 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report Screen shots ire sh rd tfo er fH yO t rsi ive Un Page 73 Department of Electronic, Communication and Electrical Engineering University of Hertfordshire BSc./BEng. Final Year Project Report ire sh rd tfo er fH yO t rsi ive Un Page 74