You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/03/02 15:34:14 UTC

[kibble-scanners] branch master updated (79c5171 -> f6cf17e)

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git.


    from 79c5171  We can accept both version 1 and 2 atm
     new 21380bf  don't kill the loop
     new f6cf17e  add forum type, and a date-string field for histograms

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/plugins/scanners/discourse.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
humbedooh@apache.org.

[kibble-scanners] 01/02: don't kill the loop

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git

commit 21380bfc1a7c55b821866fa10afe9e840117ec41
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Fri Mar 2 15:51:41 2018 +0100

    don't kill the loop
    
    scope is wrong here. it should return True at the end,
    if the loop is successful, and False within the loop when
    an error occurs.
---
 src/plugins/scanners/discourse.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/plugins/scanners/discourse.py b/src/plugins/scanners/discourse.py
index 863e4c9..cfa823e 100644
--- a/src/plugins/scanners/discourse.py
+++ b/src/plugins/scanners/discourse.py
@@ -185,12 +185,10 @@ def scanJob(KibbleBit, source, cat, creds):
                         'url': topicdoc['url']
                     }
                     KibbleBit.append('forum_post', pdoc)
-            
-        return True    
-    
-    # Boo, it failed!
-    KibbleBit.pprint("Fetching job data failed!")
-    return False
+        else:
+            KibbleBit.pprint("Fetching discourse data failed!")
+            return False
+    return True
 
 
 class discourseThread(threading.Thread):

-- 
To stop receiving notification emails like this one, please contact
humbedooh@apache.org.

[kibble-scanners] 02/02: add forum type, and a date-string field for histograms

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git

commit f6cf17e962f4a2eb2b755c245f0d2cb246dbb760
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Fri Mar 2 16:33:45 2018 +0100

    add forum type, and a date-string field for histograms
---
 src/plugins/scanners/discourse.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/plugins/scanners/discourse.py b/src/plugins/scanners/discourse.py
index cfa823e..6b2a44b 100644
--- a/src/plugins/scanners/discourse.py
+++ b/src/plugins/scanners/discourse.py
@@ -118,11 +118,13 @@ def scanJob(KibbleBit, source, cat, creds):
                     'sourceID': source['sourceID'],
                     'organisation': source['organisation'],
                     
+                    'type': 'discourse',
                     'category': cat['slug'],
                     'title': topic['title'],
                     'creator': allUsers[topic['posters'][0]['user_id']]['id'],
                     'creatorName': allUsers[topic['posters'][0]['user_id']]['name'],
                     'created': CreatedDate,
+                    'createdDate': time.strftime("%Y/%m/%d %H:%M:%S", time.gmtime(CreatedDate)),
                     'updated': UpdatedDate,
                     'solved': False,    # Discourse doesn't have this notion, but other forums might.
                     'posts': topic['posts_count'],
@@ -177,8 +179,10 @@ def scanJob(KibbleBit, source, cat, creds):
                         'sourceID': source['sourceID'],
                         'organisation': source['organisation'],
                         
+                        'type': 'discourse',
                         'creator': uhash,
                         'created': CreatedDate,
+                        'createdDate': time.strftime("%Y/%m/%d %H:%M:%S", time.gmtime(CreatedDate)),
                         'topic': dhash,
                         'post_id': post['id'],
                         'text': post['cooked'],

-- 
To stop receiving notification emails like this one, please contact
humbedooh@apache.org.