aboutsummaryrefslogtreecommitdiff
path: root/public/parse-rss-with-lua.html
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2023-10-31 11:05:28 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2023-10-31 11:05:28 +0100
commitc9d51c7de97f8af318fa7eb866c138a69676e1d7 (patch)
tree18f51726efa1ea45366d4e0f01a99888cf51d995 /public/parse-rss-with-lua.html
parent6ee7245390cdf4e19fef82c2423ba325adea4114 (diff)
downloadmitjafelicijan.com-c9d51c7de97f8af318fa7eb866c138a69676e1d7.tar.gz
Made a bunch of content fixes
Diffstat (limited to 'public/parse-rss-with-lua.html')
-rwxr-xr-xpublic/parse-rss-with-lua.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/public/parse-rss-with-lua.html b/public/parse-rss-with-lua.html
index e81f127..db879c9 100755
--- a/public/parse-rss-with-lua.html
+++ b/public/parse-rss-with-lua.html
@@ -9,7 +9,7 @@
9<a href=/index.xml target=_blank class=hob>RSS</a></nav></header><main role=main><article itemtype=http://schema.org/Article><h1 itemtype=headline>Parse RSS feeds with Lua</h1><p><cap>note</cap>, May 23, 2023 on <a href=https://mitjafelicijan.com>Mitja Felicijan's blog</a><div><p>Example of parsing RSS feeds with Lua. Before running the script install:<ul><li>feedparser with <code>luarocks install feedparser</code><li>luasocket with <code>luarocks install luasocket</code></ul><pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:#00f>local</span> http = require(<span style=color:#a31515>&#34;socket.http&#34;</span>) 9<a href=/index.xml target=_blank class=hob>RSS</a></nav></header><main role=main><article itemtype=http://schema.org/Article><h1 itemtype=headline>Parse RSS feeds with Lua</h1><p><cap>note</cap>, May 23, 2023 on <a href=https://mitjafelicijan.com>Mitja Felicijan's blog</a><div><p>Example of parsing RSS feeds with Lua. Before running the script install:<ul><li>feedparser with <code>luarocks install feedparser</code><li>luasocket with <code>luarocks install luasocket</code></ul><pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:#00f>local</span> http = require(<span style=color:#a31515>&#34;socket.http&#34;</span>)
10</span></span><span style=display:flex><span><span style=color:#00f>local</span> feedparser = require(<span style=color:#a31515>&#34;feedparser&#34;</span>) 10</span></span><span style=display:flex><span><span style=color:#00f>local</span> feedparser = require(<span style=color:#a31515>&#34;feedparser&#34;</span>)
11</span></span><span style=display:flex><span> 11</span></span><span style=display:flex><span>
12</span></span><span style=display:flex><span><span style=color:#00f>local</span> feed_url = <span style=color:#a31515>&#34;https://mitjafelicijan.com/feed.rss&#34;</span> 12</span></span><span style=display:flex><span><span style=color:#00f>local</span> feed_url = <span style=color:#a31515>&#34;https://mitjafelicijan.com/index.xml&#34;</span>
13</span></span><span style=display:flex><span> 13</span></span><span style=display:flex><span>
14</span></span><span style=display:flex><span><span style=color:#00f>local</span> response, status, _ = http.request(feed_url) 14</span></span><span style=display:flex><span><span style=color:#00f>local</span> response, status, _ = http.request(feed_url)
15</span></span><span style=display:flex><span><span style=color:#00f>if</span> status == 200 <span style=color:#00f>then</span> 15</span></span><span style=display:flex><span><span style=color:#00f>if</span> status == 200 <span style=color:#00f>then</span>