/
RSSNewsFeeds.txt
189 lines (142 loc) · 4.52 KB
/
RSSNewsFeeds.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
Handling sorting:
Sorting is inherited from previous menu level
Two types: Global Sorting and local sorting...
Global sorting:
<SubMenu>
<Sorting Field="Title" />
Sorts all items in the menu
<Sorting Enable="False" />
Disables sorting at that menu level
Global sorting overrrides any local sorting
Default field is "Title" when sorting is enabled
<Sorting Enable="True" />
Use internal tag value <__SortPriority> on all items and perform sorting at loadup time?
RSS Newsfeeds
<Channel>
<Title>
<Description>
<Item>
<Title>
<Description>
<dc:creator> / <creator>
<dc:date> / <date>
Create a resource for each selected newsfeed with an identifier
User can select their own personal newsfeeds
"Standard" names will be news01...news99
Newsfeed definitions:
"CurrentNewsfeed"
Section: Category
Key: Item::Title
Item::Description
Item::Creator
Item::Date
Channel::Title
Channel::Description
Feed::Title
Feed::Description
"Newsfeed"
Section: Name
Key: Title
Description
"NewsChannel"
Section: Name::channel#
Key: Title
Description
"NewsItem"
Section: Name::channel#::newsitem#
Key: Title
Description
Creator
Date
"NewsfeedCurrChannel"
Section: Name
Key: Title
Description
"NewsfeedCurrItem"
Section: Name
Key: Title
Description
Creator
Date
<RotateNewsfeeds>true</RotateNewsfeeds>
<Newsfeed enable="true" name="user" Category="Music">
<Global>True</Global>
<SelectChannel>-1</SelectChannel>
<URL>http://www.somesite.com/rss.xml</URL>
<UpdateInterval>300</UpdateInterval>
<RotateItemInterval>10</RotateItemInterval>
<Newsfeed>
<RotateNewsfeeds>true</RotateNewsfeeds>
<Newsfeed name="user">
<Global>True</Global>
<RotateChannels>False</RotateChannels>
<URL>http://www.somesite.com/rss.xml</URL>
<UpdateInterval>300</UpdateInterval>
<RotateItemInterval>10</RotateItemInterval>
<Newsfeed>
RSS Newsfeeds are an XML standard followed by many "blogs" on the net.
These enable an application to fetch headlines and brief descriptions,
along with links to the articles. MXM cannot use the links at the moment,
but it can use the remaining data from the feeds to provide constantly
updating information in your dash or screensaver! How's that for usefulness?
Users will be able to determine their own newsfeeds, and skinners can also
specify newsfeeds. They are handled in several different ways, providing the
best (hopefully) compromise between managebility and flexibility.
The first concept is that of a "current" newsfeed, channel and item... when
the user defines a group of newsfeeds, the system will update each newsfeed
at the given interval, and rotate between feeds, channels,and items in the
sequence defined in the configuration.
In the simplest terms, you could just have one newsfeed, one channel (most are
one channel anyway), with say, 10 items... MXM would use the <RotateItemInterval>
time (in seconds) to cycle the current item available as a string to the skins.
If you added a newsfeed, it's items would follow the first newsfeed's items.
Skinners can use categories, or ignore that altogether. There will also be a
user-defined perferred category. Feeds that fail to respond, of course, would
simple fail to be displayed.
MXM will ship with some pre-defined newsfeeds and the user should be able to
select by cattegory and such.
Create
RSSNewsfeedManager
Spawns thread to handle updating newsfeeds
Start at beginning of newsfeed list
For Each Newsfeed
Enabled?
YES: Require Refresh (Timer)?
YES: Fetch Feed
Sleep for 1 seconds
Sleep for 1 second
Each Newsfeed:
<RotateNewsfeeds>true</RotateNewsfeeds>
<Newsfeed name="user">
<Global>True</Global>
<RotateChannels>False</RotateChannels>
<URL>http://www.somesite.com/rss.xml</URL>
<UpdateInterval>300</UpdateInterval>
<RotateItemInterval>10</RotateItemInterval>
<Newsfeed>
CNewsFeed
bool m_bEnabled;
DWORD m_dwRefreshTime;
DWORD m_dwRefreshInterval;
DWORD m_dwItemTime;
DWORD m_dwItemInterval;
CXMLNode * m_pxmlNode;
CStdString m_sName;
DWORD m_dwCategories;
CStdString m_bSelectChannel;
CStdString m_sURL;
void SetCategory( DWORD dwFlags );
CXMLNode * GetNode( void );
CStdString GetItemValue( LPCTSTR szSection, LPCTSTR szKey );
CStdString GetChannelValue( LPCTSTR szSection, LPCTSTR szKey );
int m_iCurrentChannel;
int m_iCurrentItem;
bool IsCategory( DWORD dwFlag )
CNewsFeedManager
TMapNewsFeeds m_nfm;
static DWORD NewsFeedThread(DWORD dwContext);
bool AddNewsFeed( CXMLNode * pNode, bool bMain );
CStdString m_sCategory;
int m_iCurrentFeed;
int m_iCurrentChannel;
int m_iCurrentItem;