]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/article.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 10 Jul 2018 10:29:26 +0000 (11:29 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 10 Jul 2018 10:29:26 +0000 (11:29 +0100)
lib/postgres/article.sql
lib/postgres/website.sql
www/dbq/dbq.php

index 59daf3f568d0ee3ba9a0620f4e2907316d534720..abefe0594d67e56b6be54df118a380f80d48da86 100644 (file)
@@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS article (
 CREATE TEMPORARY TABLE _article AS SELECT * FROM article LIMIT 0;
 BEGIN TRANSACTION;
 DELETE FROM _article;
-COPY _article FROM PROGRAM '. /etc/profile && psql data -Atc "select rss from website" \
+COPY _article FROM PROGRAM '. /etc/profile && psql data -Atc "select rss from website where rss_on" \
 | xargs -n 1 rss-feedparser | sed "s/\$/\tf/"
 ' WITH (format 'text', NULL ''); 
 INSERT INTO article SELECT * FROM _article ON CONFLICT (url) DO NOTHING;
index 92cbeb4a9d0ca59528c09440ffd5e72244f945f9..d50e6c5395ce09784850c8bb3929518aba3b48a7 100644 (file)
@@ -7,19 +7,20 @@ CREATE TABLE IF NOT EXISTS website (
   name varchar(200),
   description varchar(500),
   --url varchar(200),
-  rss varchar(300)
+  rss varchar(300),
+  rss_on boolean DEFAULT 't'
 );
 BEGIN TRANSACTION;
 DELETE FROM website;
 COPY website FROM STDIN WITH (format 'text', NULL '');
-https://www.corbettreport.com  eng     The Corbett Report      Open Source Intelligence News   https://feeds.feedburner.com/CorbettReportRSS
-https://wearechange.or/        eng     We Are Change   Be the Change You Wish to See in the World      https://feeds.feedburner.com/wrc
-https://www.egaliteetreconciliation.fr fra     Egalite et Réconciliation      Gauche du travail, Droite des valeurs : pour une réconciliation nationale !    https://www.egaliteetreconciliation.fr/spip.php?page=backend
-https://www.infowars.com       eng     INFOWARS        Alex Jones' Infowars: There's a war on for your mind!   https://www.infowars.com/feed/custom_feed_rss
-https://www.tvlibertes.com     fra     TVL     TVLibertés - 1ère chaîne de réinformation. Nous, c'est vous https://www.tvlibertes.com/feed
-https://www.rt.com     eng     RT International        RT is the first Russian 24/7 English-language news channel which brings the Russian view on global news.        https://www.rt.com/rss
-https://pressfortruth.ca       eng     Press For Truth Press For Truth is a team of videographers, investigative journalists and political activists. We do our best to expose the global elite and their plans for a new world order. https://pressfortruth.ca/index.php/tools/blocks/problog_list/rss?cID=147
-https://www.youtube.com/channel/UC2aQGaCZjQC1lM3DOwbCIFw       eng     The Truth Factory       The Truth Factory       https://www.youtube.com/feeds/videos.xml?channel_id=UC2aQGaCZjQC1lM3DOwbCIFw
+https://www.corbettreport.com  eng     The Corbett Report      Open Source Intelligence News   https://feeds.feedburner.com/CorbettReportRSS   t
+https://wearechange.or/        eng     We Are Change   Be the Change You Wish to See in the World      https://feeds.feedburner.com/wrc        t
+https://www.egaliteetreconciliation.fr fra     Egalite et Réconciliation      Gauche du travail, Droite des valeurs : pour une réconciliation nationale !    https://www.egaliteetreconciliation.fr/spip.php?page=backend    t
+https://www.infowars.com       eng     INFOWARS        Alex Jones' Infowars: There's a war on for your mind!   https://www.infowars.com/feed/custom_feed_rss   t
+https://www.tvlibertes.com     fra     TVL     TVLibertés - 1ère chaîne de réinformation. Nous, c'est vous https://www.tvlibertes.com/feed t
+https://www.rt.com     eng     RT International        RT is the first Russian 24/7 English-language news channel which brings the Russian view on global news.        https://www.rt.com/rss  t
+https://pressfortruth.ca       eng     Press For Truth Press For Truth is a team of videographers, investigative journalists and political activists. We do our best to expose the global elite and their plans for a new world order. https://pressfortruth.ca/index.php/tools/blocks/problog_list/rss?cID=147        t
+https://www.youtube.com/channel/UC2aQGaCZjQC1lM3DOwbCIFw       eng     The Truth Factory       The Truth Factory       https://www.youtube.com/feeds/videos.xml?channel_id=UC2aQGaCZjQC1lM3DOwbCIFw    t
 \.
--- 5|eng|Youtube INFO WARS NEWS||https://www.youtube.com/channel/UCUIjs9R044OjAxKzk0xhGoQ|https://www.youtube.com/feeds/videos.xml?channel_id=UCUIjs9R044OjAxKzk0xhGoQ
+-- 5|eng|Youtube INFO WARS NEWS||https://www.youtube.com/channel/UCUIjs9R044OjAxKzk0xhGoQ|https://www.youtube.com/feeds/videos.xml?channel_id=UCUIjs9R044OjAxKzk0xhGoQ t
 COMMIT;
index afb1486038200472e2181a2205ed1ac9fd1946e2..cd5ba4231fcdd6a8fe853d98b260f3183771bc42 100644 (file)
@@ -447,6 +447,14 @@ class DbQ extends nb {
                $keys = array_keys($keys);
 
                $values = ($_SERVER['REQUEST_METHOD'] == 'POST') ? $_POST : explode($this->param_args_sep,$this->params['args']);
+               if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+                       $values = $_POST;
+               } elseif($this->params['args']) {
+                       $values = explode($this->param_args_sep,$this->params['args']);
+               } else {
+                       $values = $_GET;
+               }
+
                foreach ($values as $k=>$v) {
                        if (!in_array($k,$keys)) unset($values[$k]);
                }
@@ -1352,7 +1360,7 @@ EOF;
 
                } elseif ($action == 'rm') {
                        $this->deniedUnless($this->perm >= self::DELETE);
-                       if (!$this->table->delete($_POST,$info)) $this->error('rm: '.print_r($info,true));
+                       if (!$this->table->delete(empty($_POST) ? $_GET : $_POST,$info)) $this->error('rm: '.print_r($info,true));
                        $this->redirect_if_no_referer($this->table->base.'/');
                        $this->page($info);
 
@@ -1368,6 +1376,7 @@ EOF;
        }
 
        public function redirect_if_no_referer($url) {
+               if (!empty($_SERVER['HTTP_REFERER'])) $url = $_SERVER['HTTP_REFERER'];
                if ($this->p('referer')) $url = urldecode($this->p('referer'));
                header('Location: '.$url);
        }