From af26179d15a42451ea67a171bdb71d800e210194 Mon Sep 17 00:00:00 2001 From: Konstantin Ufimtsev Date: Mon, 1 Jul 2013 22:52:14 +1000 Subject: getting last_marked value from starred.json --- plugins/googlereaderimport/init.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/googlereaderimport/init.php b/plugins/googlereaderimport/init.php index 2e22161b9..dcb335a0d 100644 --- a/plugins/googlereaderimport/init.php +++ b/plugins/googlereaderimport/init.php @@ -114,6 +114,7 @@ class GoogleReaderImport extends Plugin { $guid = db_escape_string(mb_substr($item['id'], 0, 250)); $title = db_escape_string($item['title']); $updated = date('Y-m-d h:i:s', $item['updated']); + $last_marked = date('Y-m-d h:i:s', mb_substr($item['crawlTimeMsec'], 0, 10)); $link = ''; $content = ''; $author = db_escape_string($item['author']); @@ -165,7 +166,7 @@ class GoogleReaderImport extends Plugin { $imported += (int) $this->create_article($owner_uid, $guid, $title, $link, $updated, $content, $author, $sql_set_marked, $tags, - $orig_feed_data); + $orig_feed_data, $last_marked); if ($file && $processed % 25 == 0) { _debug("processed $processed articles..."); @@ -196,7 +197,7 @@ class GoogleReaderImport extends Plugin { } // expects ESCAPED data - private function create_article($owner_uid, $guid, $title, $link, $updated, $content, $author, $marked, $tags, $orig_feed_data) { + private function create_article($owner_uid, $guid, $title, $link, $updated, $content, $author, $marked, $tags, $orig_feed_data, $last_marked) { if (!$guid) $guid = sha1($link); @@ -299,7 +300,7 @@ class GoogleReaderImport extends Plugin { (ref_id, uuid, feed_id, orig_feed_id, owner_uid, marked, tag_cache, label_cache, last_read, note, unread, last_marked) VALUES - ('$ref_id', '', NULL, $orig_feed_id, $owner_uid, $marked, '', '', NOW(), '', false, NOW())"); + ('$ref_id', '', NULL, $orig_feed_id, $owner_uid, $marked, '', '', '$last_marked', '', false, '$last_marked')"); $result = db_query("SELECT int_id FROM ttrss_user_entries, ttrss_entries WHERE owner_uid = $owner_uid AND ref_id = id AND ref_id = $ref_id"); -- cgit v1.2.3 From 47fecba235400e0d7a5a7c54c9ff201c0840deec Mon Sep 17 00:00:00 2001 From: justauser Date: Sun, 7 Jul 2013 13:53:23 -0400 Subject: changes to add hook_query_headlines --- plugins/query_headlines/init.js | 0 plugins/query_headlines/init.php | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 plugins/query_headlines/init.js create mode 100644 plugins/query_headlines/init.php (limited to 'plugins') diff --git a/plugins/query_headlines/init.js b/plugins/query_headlines/init.js new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/query_headlines/init.php b/plugins/query_headlines/init.php new file mode 100644 index 000000000..5d71d0356 --- /dev/null +++ b/plugins/query_headlines/init.php @@ -0,0 +1,50 @@ +host = $host; + $host->add_hook($host::HOOK_QUERY_HEADLINES, $this); + } + + // passes in the array for an item + // second argument is the length of the preview the caller is using + // create a key called "modified_preview" if you change the preview and don't want + // caller to override with their default + + function hook_query_headlines($line, $preview_length = 100,$api_call=false) { + //make the author field empty + $line["author"] = ""; + + // and toss tags, since I don't use + $line["tag_cache"] = ""; + return $line; + + + } + + + function api_version() { + return 2; + } + +} +?> -- cgit v1.2.3