Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Write RSS Feed Reader for YouTube Videos
I have tried reading various tutorials on line with just further confusion.
I would like to write the project with VS 2019 Version 16.7.5 Net Framework 4.8 VB.Net and SQLite DB. Windows 7 64 bit Pro Machine.
The most important question for me is "What tools to use?"
All my experience with Web-Pages is with HTML CSS and JavaScript. That will not work for this project. I am guessing I need to use ASP.Net.
My design is to store the YouTube URL in a DB with the Name of the channel.
I do not see RSS feed data on the YouTube Chanel's in question.
I would like to only populate a Data Grid View with a link to the channel when new content is posted. This desire will require knowing where to find new content notification information. Again I am guessing!
I have seen suggestions to use extensions in the browser but would prefer to not use that idea. I can manage the DB storage. Getting the new notification information I am completely at a design loss. I also do not want to Subscribe and Ring a bunch of Notification bells.

If I absolutely need C# I will make the effort to learn but not my first choice.

What I have tried:

I looked at this POST I get the idea a little but still lost on how to design and what to use

RealNews - WinForms RSS Reader similar to FeedReader[^]
Posted
Updated 11-Jan-22 8:08am

 
Share this answer
 
Comments
Choroid 11-Jan-22 14:08pm    
Can you take a look at my Solution and the ERROR
Choroid 11-Jan-22 21:05pm    
Richard This got way more complex than I could have ever believed possible
Here is the solution to the issue it was a Windows 7 and the Registry File
Here is a link to the solution
https://stackoverflow.com/questions/70674832/windows-7-could-not-create-ssl-tls-secure-channel-system-net-webexception
Richard Here is what I have learned from your Solution
BUT this code continues to give me the ERROR
Could Not Load Type RSSFeedReader_default
Any Help Fixing the Error would be greatly appreciated

Here is the code with some commented out things I have tried to fix the Error

'Option Strict On
Option Explicit On
'Public Class _default

Partial Public Class _default
    Inherits System.Web.UI.Page
    'Protected WithEvents Form1 As Global.System.Web.UI.HtmlControls.HtmlForm

    'Protected WithEvents gvRss As Global.System.Web.UI.WebControls.GridView

    'Protected WithEvents lblLogMsg As Global.System.Web.UI.WebControls.Label

    Private gvRss As Object

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'ToDo: replace with the URL to your desired RSS feed
        Dim rssFeedUrls As List(Of String) = New List(Of String)()

        'add desired URLs
        rssFeedUrls.Add("https://www.nasa.gov/rss/dyn/lg_image_of_the_day.rss")
        rssFeedUrls.Add("http://thehill.com/rss/syndicator/19110")

        'get data
        PopulateRssFeed(rssFeedUrls)
    End Sub

    Private Sub PopulateRssFeed(rssFeedUrls As List(Of String))
        'create new List
        Dim feeds As List(Of RSSFeed) = New List(Of RSSFeed)
        Dim currentURL As String = String.Empty

        Try
            For Each url As String In rssFeedUrls

                'set value
                currentURL = url

                'create new instance
                Dim xDoc As XDocument = New XDocument()

                'load
                xDoc = XDocument.Load(url)

                Dim items = From x In xDoc.Descendants("item")
                            Select New RSSFeed With
                            {
                                .Title = x.Element("title").Value,
                                .Link = x.Element("link").Value,
                                .PublishDate = x.Element("pubDate").Value,
                                .Description = x.Element("description").Value
                            }

                If items IsNot Nothing Then
                    For Each i In items
                        Dim f As RSSFeed = New RSSFeed() With {
                            .Title = i.Title,
                            .Link = i.Link,
                            .PublishDate = i.PublishDate,
                            .Description = i.Description
                            }

                        'add 
                        feeds.Add(f)
                    Next
                End If
            Next

            gvRss.DataSource = feeds
            gvRss.DataBind()
        Catch ex As Exception
            'ToDo: replace with desired code
            Dim errMsg As String = String.Format("Error (PopulateRssFeed): {0} (url: {1})", ex.Message, currentURL)
            'Debug.WriteLine(errMsg)
            'WriteLine(errMsg)
            MsgBox("ER " & errMsg)
            Throw ex
        End Try
    End Sub
End Class


Imports Microsoft.VisualBasic

Public Class RSSFeed
    Public Property Title As String
    Public Property Link As String
    Public Property PublishDate As String
    Public Property Description As String
End Class


This is the code causing the Error the very first line

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="RSSFeedReader._Default" %>
<!DOCTYPE html5>

<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <h3>Read RSS Feed from "NASA"</h3>

        <form id="Form1" runat="server" >

            <!-- Where XYZ refers to the publication from where you wish to fetch the RSS feed from -->
            <div style="max-height:350px; overflow:auto">
                <asp:GridView ID="gvRss" runat="server" AutoGenerateColumns="false" ShowHeader="false" Width="90%">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <table width="100%" border="0" cellpadding="0" cellspacing="5">
                                    <tr>
                                        <td>
                                            <h3 style="color:#3E7CFF"><%#Eval("Title") %></h3>
                                        </td>
                                        <td width="200px">
                                            <%#Eval("PublishDate") %>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <hr />
                                            <%#Eval("Description") %>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td> </td>
                                        <td align="right">
                                            <a href='<%#Eval("Link") %>' target="_blank">Read More...</a>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>    
        </form>
    </body>
</html>
 
Share this answer
 
Comments
Richard MacCutchan 11-Jan-22 14:43pm    
Your class is named _default, which is not the same as _Default. Both names must use the same case (upper or lower) for all characters.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900