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 2017/10/24 12:07:44 UTC

[kibble-scanners] branch master updated (ca73010 -> c1c6ace)

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 ca73010  compact, add doc_as_upsert for updates which 404s
     new b1a142f  some lists require credentials
     new c1c6ace  bugzilla is also a known robit

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/ponymail-tone.py | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@kibble.apache.org" <co...@kibble.apache.org>'].

[kibble-scanners] 02/02: bugzilla is also a known robit

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 c1c6ace2cd27636ddad2e9bef3fad9714d400b6e
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Oct 24 14:07:36 2017 +0200

    bugzilla is also a known robit
---
 src/plugins/scanners/ponymail-tone.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/scanners/ponymail-tone.py b/src/plugins/scanners/ponymail-tone.py
index e6ffaa6..fd771a4 100644
--- a/src/plugins/scanners/ponymail-tone.py
+++ b/src/plugins/scanners/ponymail-tone.py
@@ -30,7 +30,7 @@ import plugins.utils.tone
 
 title = "Tone/Mood Scanner plugin for Apache Pony Mail"
 version = "0.1.0"
-ROBITS = r"(git|gerrit|jenkins|hudson|builds)@"
+ROBITS = r"(git|gerrit|jenkins|hudson|builds|bugzilla)@"
 MAX_COUNT = 50
 
 def accepts(source):

-- 
To stop receiving notification emails like this one, please contact
"commits@kibble.apache.org" <co...@kibble.apache.org>.

[kibble-scanners] 01/02: some lists require credentials

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 b1a142f1272bf29e67fbc7c9fbcd6a301717e9d6
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Oct 24 14:07:24 2017 +0200

    some lists require credentials
    
    also switch to the json plugin for fetching data, since that
    handles cookies already
---
 src/plugins/scanners/ponymail-tone.py | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/src/plugins/scanners/ponymail-tone.py b/src/plugins/scanners/ponymail-tone.py
index 69f7623..e6ffaa6 100644
--- a/src/plugins/scanners/ponymail-tone.py
+++ b/src/plugins/scanners/ponymail-tone.py
@@ -65,6 +65,10 @@ def scan(KibbleBit, source):
         KibbleBit.pprint("No Watson/BlueMix creds configured, skipping tone analyzer")
         return
     
+    cookie = None
+    if 'creds' in source and source['creds']:
+        cookie = source['creds'].get('cookie', None)
+        
     rootURL = re.sub(r"list.html.+", "", source['sourceURL'])
     query = {
             'query': {
@@ -98,15 +102,20 @@ def scan(KibbleBit, source):
             if 'mood' not in eml:
                 emlurl = "%s/api/email.lua?id=%s" % (rootURL, eml['id'])
                 KibbleBit.pprint("Fetching %s" % emlurl)
-                rv = requests.get(emlurl).json()
-                body = rv['body']
-                KibbleBit.pprint("analyzing email")
-                mood = plugins.utils.tone.getTone(KibbleBit, body)
-                eml['mood'] = mood
-                hm = [0,'unknown']
-                for m, s in mood.items():
-                    if s > hm[0]:
-                        hm = [s,m]
-                print("Likeliest overall mood: %s" % hm[1])
-                KibbleBit.index('email', hit['_id'], eml)
+                rv = None
+                try:
+                    rv = plugins.utils.jsonapi.get(emlurl, cookie = cookie)
+                except Exception as err:
+                    KibbleBit.pprint("Server error, skipping this email")
+                if rv and 'body' in rv:
+                    body = rv['body']
+                    KibbleBit.pprint("analyzing email")
+                    mood = plugins.utils.tone.getTone(KibbleBit, body)
+                    eml['mood'] = mood
+                    hm = [0,'unknown']
+                    for m, s in mood.items():
+                        if s > hm[0]:
+                            hm = [s,m]
+                    print("Likeliest overall mood: %s" % hm[1])
+                    KibbleBit.index('email', hit['_id'], eml)
     KibbleBit.pprint("Done with tone analysis")

-- 
To stop receiving notification emails like this one, please contact
"commits@kibble.apache.org" <co...@kibble.apache.org>.