List of commits:
Subject Hash Author Date (UTC)
finish feeds tree deea8b12636ba4a19ee256629a9a2a9874baf9c1 Alex 2022-07-15 17:10:11
Explore window is ready... 959e6dbf4fc77e315ac12847a481e25f50785ed4 Alex 2022-07-14 22:13:38
fixes in lurk code d741423d070a4d51b76d270fac70e0b0c3d04035 Alex 2022-07-14 15:29:42
Clear explored list by inbuild function 9ec9232bf28d0d83461e89fa89e8105983d5e3ba Alex 2022-07-14 14:09:54
implement URL constructing (complement URLs) f4798ed246e9c6d4b1a611b48ed5a7eb28c8938d Alex 2022-07-14 01:16:31
parser part of Explore is ready 87b01db3296eab71b2a510c4d0924127efac1a7f Alex 2022-07-13 22:36:39
prepare code for Explore 76b6472a8ad28564a55c6bd39f55ba050dd3599f Alex 2022-07-13 19:05:02
advance Explore window by statusbar and Stop button 8f7ae012ede287fc6e20fd5727fd215293c75b25 Alex 2022-07-13 17:24:24
prepare Explore window 9da7bcfcc06c986dd4ece8813096a9086ad690fc Alex 2022-07-13 01:59:32
comment out Edit option: není na to podpora v MUI Royale. Posunout polo¾ky menu, aby kursor nedopadal poøad na Remove 46c2f3cbbc2912eefb9504c7632f65ed57bc47e5 Alex 2022-07-12 23:14:48
fix code formatting for remove requesters 535d4b6515a4744e0b6af6090daadbb85f38b8cf Alex 2022-07-12 23:04:43
implement adding of single feed e938d0a6d769c7caf876dfdba9f43ce668eb4690 Alex 2022-07-12 22:05:10
implement group adding d347e25e93e94f711c4098fecc9775af22eb7309 Alex 2022-07-12 20:12:00
make parser to work somehow bb968a00680246434eb1f9795ebde4babea3fb05 Alex 2022-07-12 05:19:43
some preparations for parsing 0259ef32db69fdb45bc9e67d88c74aca4ae69ce6 Alex 2022-07-12 03:59:45
prepare png icon b7dc494acb640d92c5b7b49bc2ee93fd5a0d521c Alex 2022-07-11 07:17:47
fetching is ready 0d01c38238a2ea7e39bc671de1997294231d8549 Alex 2022-07-11 06:37:06
read feeds from feeds.json U¾ivatel asi bude chtit mít své fidy u sebe de14a1e9f5a99f79e44985073df04e89bae2c116 Alex 2022-07-11 01:26:52
prepare default feeds d2b45f0007c30da84662b8b2a1f2118d03e30e1f Alex 2022-07-11 01:25:58
prepare Lock&Unlock f76041ef4fa2b6d5301afb34bda5de13f8ff2701 Alex 2022-07-10 00:37:38
Commit deea8b12636ba4a19ee256629a9a2a9874baf9c1 - finish feeds tree
Author: Alex
Author date (UTC): 2022-07-15 17:10
Committer name: Alex
Committer date (UTC): 2022-07-15 17:10
Parent(s): 959e6dbf4fc77e315ac12847a481e25f50785ed4
Signer:
Signing key:
Signing status: N
Tree: c939ca363c59aab33dc8447238c5cbd744c82882
File Lines added Lines deleted
IvoRSS.hws 39 1
feedtree.hws 105 24
File IvoRSS.hws changed (mode: 100755) (index 9ee3bec..2624c92)
... ... PleaseStop = True
31 31
32 32
33 33
34 feedsdata = {}
35
36
37 ;udm kudžem byrjem pajmíško...
38 Function feedsdata:isEqualOrSet(feedid$, key, value)
39 Local t = RawGet(self, feedid$)
40 If GetType(t) <> #TABLE
41 t = {}
42 self[feedid$] = t ;RawSet(self, feedid$, t)
43 EndIf
44
45 If RawGet(t, key) = value Then Return(True)
46 ;č nic?
47 RawSet(t, key, value)
48 Return(False)
49 EndFunction
50
51 ;easy to understand, but so elegant
52 Function feedsdata:CheckAndSet(feedid$, key, value)
53 If HaveItem(self, feedid$)
54 Local t = self[feedid$]
55 If RawGet(t, key) = value
56 Return(False)
57 Else
58 RawSet(t, key, value)
59 Return(True)
60 Endif
61 EndIf
62
63 self[feedid$] = {}
64 RawSet(self[feedid$], key, value)
65 EndFunction
66
67
68
34 69 ;Width=#KEEPASPRAT ;Width=#KEEPASPRAT
35 70 /* /*
36 71 ** Handles all incoming events ** Handles all incoming events
 
... ... Function p_StartUpLoading()
296 331 err_code = ?p_FillListTree("feedtree", DeserializeTable(s$)) err_code = ?p_FillListTree("feedtree", DeserializeTable(s$))
297 332 p_Replay(err_code, "Feeds are imported") p_Replay(err_code, "Feeds are imported")
298 333
299 feedsdata = {} ; Global
334 ;feedsdata = {} ; Global
300 335 err_code = ?LoadPrefs(feedsdata) err_code = ?LoadPrefs(feedsdata)
301 336 p_Replay(err_code, "Settings loaded") p_Replay(err_code, "Settings loaded")
302 337 EndFunction EndFunction
 
... ... EndFunction
339 374
340 375
341 376
377
378
342 379 mui.CreateGUI(ReadString(1)) mui.CreateGUI(ReadString(1))
343 380 InstallEventHandler({MUIRoyale = p_MUIEvent}) InstallEventHandler({MUIRoyale = p_MUIEvent})
344 381
345 382 p_StartUpLoading() p_StartUpLoading()
346 383
347 384
385
348 386 Repeat Repeat
349 387 WaitEvent WaitEvent
350 388 Forever Forever
File feedtree.hws changed (mode: 100755) (index cfd48d2..94f1350)
1 1
2 2 Const #LIST_TREE = "feedtree" Const #LIST_TREE = "feedtree"
3 3
4 Const #FEED_STATUS_NEW = 5
5 Const #FEED_STATUS_READ = 4
6
7 Const #FEED_STATUS_SUCCESS = 1
8
9 Const #FEED_STATUS_INTERRUPTED = -2
10 Const #FEED_STATUS_ERROR = -3
11
4 12
5 13 Function p_FillListTree(listtree$, treetable) Function p_FillListTree(listtree$, treetable)
6 14 mui.Set(listtree$, "Quiet", True) mui.Set(listtree$, "Quiet", True)
 
... ... Function p_FetchCurrent()
52 60 If t.Node If t.Node
53 61 p_FetchGroup(t.muiid) p_FetchGroup(t.muiid)
54 62 Else Else
55 If p_FetchFeed(t.id) = #ERR_NONE
63 Local status = p_Fetch(t.id)
64 If status = #FEED_STATUS_NEW
65 p_MarkFeed(t.id, #FEED_STATUS_READ)
56 66 Ivor:Load(t.id) Ivor:Load(t.id)
67 ElseIf status = #FEED_STATUS_SUCCESS
68 p_MarkFeed(t.id, #FEED_STATUS_READ)
69 Else
70 p_MarkFeed(t.id, status)
57 71 EndIf EndIf
58 72 EndIf EndIf
59 73 EndIf EndIf
 
... ... EndFunction
63 77
64 78 Function p_ShowCurrent() Function p_ShowCurrent()
65 79 Local isFound, t = mui.DoMethod(#LIST_TREE, "GetEntry", "Active", "Active", "") Local isFound, t = mui.DoMethod(#LIST_TREE, "GetEntry", "Active", "Active", "")
66 If isFound And Not t.Node
67 Ivor:Load(t.id)
68 EndIf
80 If Not isFound Or t.Node Then Return()
81
82 If HaveItem(feedsdata, t.id)
83 Ivor:Load(t.id)
84 Else
85 Ivor:Clear()
86 EndIf
69 87 EndFunction EndFunction
70 88
71 89 ;č zjistit co je Node zač, ;č zjistit co je Node zač,
 
... ... Function p_FetchGroup(muiid$)
84 102 EndFunction EndFunction
85 103
86 104
87 ;č stáhnout soubor, spočítat hešy,
88 105 ;č označit buď jako nové, nebo jako přečtené ;č označit buď jako nové, nebo jako přečtené
89 106 ;č smí se posílat JENOM fidy, nikoliv skupiny ;č smí se posílat JENOM fidy, nikoliv skupiny
90 107 Function p_FetchFeed(feedid$) Function p_FetchFeed(feedid$)
91 If HaveItem(feedsdata, feedid$)
92 ;č Pokud záznam existuje, MUSÍ mít MD5Sum a Name atributy
93 Local t = feedsdata[feedid$]
94 If err_code = #ERR_NONE
95 mui.DoMethod(#LIST_TREE, "Rename", feedid$, "\27".."5\27b" .. feedid$)
96 Else
97 mui.DoMethod(#LIST_TREE, "Rename", feedid$, "\27i" .. feedid$)
98 EndIf
99 Else
100 Local err_code = p_Download(feedid$, p_GetXMLname(feedid$))
101 ;č zde je to jednoduchý, stahování je bud úspěšné, nebo neúspěšné
102 mui.DoMethod(#LIST_TREE, "Rename", feedid$,
103 IIf(err_code = #ERR_NONE, "\27".."5\27b", "\27i") .. feedid$)
104
108 Local status = p_Fetch(feedid$)
109 If status = #FEED_STATUS_SUCCESS
110 If HaveItem(feedsdata, feedid$)
111 Local t = feedsdata[feedid$]
112 If RawGet(t, "status") = #FEED_STATUS_NEW Then Return()
113 EndIf
114 status = #FEED_STATUS_READ
105 115 EndIf EndIf
106 Return(err_code)
116 p_MarkFeed(feedid$, status)
107 117 EndFunction EndFunction
108 118
109 119
120
121 Function p_MarkFeed(feedid$, status)
122 If feedsdata:isEqualOrSet(feedid$, "status", status) Then Return()
123
124
125 Local preparse$ = ""
126 Switch status
127 Case #FEED_STATUS_NEW:
128 preparse$ = "\27".."5\27b"
129 Case #FEED_STATUS_READ:
130 preparse$ = "\27".."5"
131 Case #FEED_STATUS_INTERRUPTED:
132 preparse$ = "\27".."5\27i"
133 Case #FEED_STATUS_ERROR:
134 preparse$ = "\27i"
135 EndSwitch
136
137 mui.DoMethod(#LIST_TREE, "Rename", feedid$, preparse$ .. feedid$)
138 EndFunction
139
140
141
142
143
144
110 145 Function p_RemoveCurrent() Function p_RemoveCurrent()
111 146 Local isFound, t = mui.DoMethod(#LIST_TREE, "GetEntry", "Active", "Active", "") Local isFound, t = mui.DoMethod(#LIST_TREE, "GetEntry", "Active", "Active", "")
112 147 If isFound And mui.Request("Delete ".. IIf(t.Node, "group", "RSS feed"), If isFound And mui.Request("Delete ".. IIf(t.Node, "group", "RSS feed"),
 
... ... Function p_RemoveCurrent()
115 150 "Yes|*Cancel", "Warning") "Yes|*Cancel", "Warning")
116 151 mui.DoMethod(#LIST_TREE, "Remove", "Active", t.id) mui.DoMethod(#LIST_TREE, "Remove", "Active", t.id)
117 152 ;č vyhodit i přidružená data. ;č vyhodit i přidružená data.
118 ;č Hollywood se pak doopravdy se tváří, že tu položku nikdy neznal,
119 ;č HaveItem je vrací lež no a přístup pak způsobí chybu
153 ;č Hollywood se pak doopravdy tváří, že tu položku nikdy neznal,
154 ;č HaveItem vrací lež no a přístup pak způsobí chybu
120 155 feedsdata[t.id] = nil feedsdata[t.id] = nil
121 156 ;č Na soubory ve složce Feeds sereme? ;č Na soubory ve složce Feeds sereme?
122 157 EndIf EndIf
 
... ... EndFunction
193 228
194 229
195 230 Function p_HideFeeds() Function p_HideFeeds()
196 mui.DoMethod("feedtree", "close", "root", "all")
231 mui.DoMethod(#LIST_TREE, "close", "root", "all")
197 232 EndFunction EndFunction
198 233
199 234 Function p_ExpandFeeds() Function p_ExpandFeeds()
200 mui.DoMethod("feedtree", "open", "root", "all")
235 mui.DoMethod(#LIST_TREE, "open", "root", "all")
201 236 EndFunction EndFunction
202 237
238
239
240
241
242
243
244
245
246
247
248
249 ;č stáhnout soubor
250 ;č možné statusy
251 /*
252 #FEED_STATUS_NEW
253 #FEED_STATUS_SUCCESS
254 #FEED_STATUS_INTERRUPTED
255 #FEED_STATUS_ERROR
256 */
257 Function p_Fetch(url$)
258 ;č zjednodušená kontrola, pokud řetězec obsahuje procenta,
259 ;č považujeme ho za "eskejpnutý".
260 ;č Na případ, kdy uživatel strčí do URLu osamělý znak procenta vysereme
261 Local err_code, xml$, count = ?DownloadFile(url$,
262 {Adapter="hurl", Fail404=True, Encoded=FindStr(url$, "%", True) <> -1},
263 p_callback, url$)
264 p_Replay(err_code, count .. "bytes from " .. url$ .. " transmitted")
265 CheckEvents() ; keep MUI even more responsive
266 If err_code <> #ERR_NONE Then Return(#FEED_STATUS_ERROR)
267
268 If PleaseStop Then Return(#FEED_STATUS_INTERRUPTED)
269
270 If feedsdata:isEqualOrSet(url$, "checksum", CRC32Str(xml$))
271 Return(#FEED_STATUS_SUCCESS)
272 EndIf
273
274 Local err_code = ?StringToFile(xml$, p_GetXMLname(url$))
275 p_Replay(err_code, "\27".."5\27bUpdated!")
276 If err_code = #ERR_NONE
277 Return(#FEED_STATUS_NEW)
278 Else
279 ;č Aha... Tak zpětně vynulujeme čeksumu, aby příště zkusil to uložit znovu
280 RawSet(feedsdata[url$], "checksum", False)
281 Return(#FEED_STATUS_ERROR)
282 EndIf
283 EndFunction
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/iam-git/IvoRSS

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/iam-git/IvoRSS

Clone this repository using git:
git clone git://git.rocketgit.com/user/iam-git/IvoRSS

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main