Hello community,

here is the log from the commit of package python-shodan for openSUSE:Factory 
checked in at 2020-02-09 20:49:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-shodan (Old)
 and      /work/SRC/openSUSE:Factory/.python-shodan.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-shodan"

Sun Feb  9 20:49:33 2020 rev:20 rq:772355 version:1.21.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-shodan/python-shodan.changes      
2020-01-25 13:25:40.392076339 +0100
+++ /work/SRC/openSUSE:Factory/.python-shodan.new.26092/python-shodan.changes   
2020-02-09 20:49:35.118915032 +0100
@@ -1,0 +2,6 @@
+Sat Feb  1 15:16:40 UTC 2020 - Sebastian Wagner <[email protected]>
+
+- update to version 1.21.3:
+ - Fix geo.json file converter
+
+-------------------------------------------------------------------

Old:
----
  shodan-1.21.2.tar.gz

New:
----
  shodan-1.21.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-shodan.spec ++++++
--- /var/tmp/diff_new_pack.GU475a/_old  2020-02-09 20:49:36.090915587 +0100
+++ /var/tmp/diff_new_pack.GU475a/_new  2020-02-09 20:49:36.094915589 +0100
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %{!?license: %global license %doc}
 Name:           python-shodan
-Version:        1.21.2
+Version:        1.21.3
 Release:        0
 Summary:        Python library and command-line utility for Shodan
 License:        MIT

++++++ shodan-1.21.2.tar.gz -> shodan-1.21.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shodan-1.21.2/CHANGELOG.md 
new/shodan-1.21.3/CHANGELOG.md
--- old/shodan-1.21.2/CHANGELOG.md      2020-01-07 06:41:53.000000000 +0100
+++ new/shodan-1.21.3/CHANGELOG.md      2020-01-20 20:57:07.000000000 +0100
@@ -1,6 +1,10 @@
 CHANGELOG
 =========
 
+1.21.3
+------
+* Fix geo.json file converter
+
 1.21.2
 ------
 * Add support for paging through the domain information
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shodan-1.21.2/PKG-INFO new/shodan-1.21.3/PKG-INFO
--- old/shodan-1.21.2/PKG-INFO  2020-01-07 06:44:06.000000000 +0100
+++ new/shodan-1.21.3/PKG-INFO  2020-01-20 21:22:45.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: shodan
-Version: 1.21.2
+Version: 1.21.3
 Summary: Python library and command-line utility for Shodan 
(https://developer.shodan.io)
 Home-page: http://github.com/achillean/shodan-python/tree/master
 Author: John Matherly
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shodan-1.21.2/setup.py new/shodan-1.21.3/setup.py
--- old/shodan-1.21.2/setup.py  2020-01-07 06:38:20.000000000 +0100
+++ new/shodan-1.21.3/setup.py  2020-01-20 20:55:55.000000000 +0100
@@ -7,7 +7,7 @@
 
 setup(
     name='shodan',
-    version='1.21.2',
+    version='1.21.3',
     description='Python library and command-line utility for Shodan 
(https://developer.shodan.io)',
     long_description=README,
     long_description_content_type='text/x-rst',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shodan-1.21.2/shodan/cli/converter/geojson.py 
new/shodan-1.21.3/shodan/cli/converter/geojson.py
--- old/shodan-1.21.2/shodan/cli/converter/geojson.py   2019-02-11 
03:19:42.000000000 +0100
+++ new/shodan-1.21.3/shodan/cli/converter/geojson.py   2020-01-20 
20:49:17.000000000 +0100
@@ -1,4 +1,4 @@
-
+from json import dumps
 from .base import Converter
 from ...helpers import get_ip, iterate_files
 
@@ -18,40 +18,35 @@
         # Write the header
         self.header()
 
-        hosts = {}
+        # We only want to generate 1 datapoint for each IP - not per service
+        unique_hosts = set()
         for banner in iterate_files(files):
             ip = get_ip(banner)
             if not ip:
                 continue
 
-            if ip not in hosts:
-                hosts[ip] = banner
-                hosts[ip]['ports'] = []
-
-            hosts[ip]['ports'].append(banner['port'])
-
-        for ip, host in iter(hosts.items()):
-            self.write(host)
+            if ip not in unique_hosts:
+                self.write(ip, banner)
+                unique_hosts.add(ip)
 
         self.footer()
 
-    def write(self, host):
+    def write(self, ip, host):
         try:
-            ip = get_ip(host)
             lat, lon = host['location']['latitude'], 
host['location']['longitude']
-
-            feature = """{
-                "type": "Feature",
-                "id": "{}",
-                "properties": {
-                    "name": "{}"
-                 },
-                "geometry": {
-                    "type": "Point",
-                    "coordinates": [{}, {}]
-                }
-            }""".format(ip, ip, lat, lon)
-
-            self.fout.write(feature)
-        except Exception:
+            feature = {
+                'type': 'Feature',
+                'id': ip,
+                'properties': {
+                    'name': ip,
+                    'lat': lat,
+                    'lon': lon,
+                },
+                'geometry': {
+                    'type': 'Point',
+                    'coordinates': [lon, lat],
+                },
+            }
+            self.fout.write(dumps(feature) + ',')
+        except Exception as e:
             pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shodan-1.21.2/shodan.egg-info/PKG-INFO 
new/shodan-1.21.3/shodan.egg-info/PKG-INFO
--- old/shodan-1.21.2/shodan.egg-info/PKG-INFO  2020-01-07 06:44:06.000000000 
+0100
+++ new/shodan-1.21.3/shodan.egg-info/PKG-INFO  2020-01-20 21:22:45.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: shodan
-Version: 1.21.2
+Version: 1.21.3
 Summary: Python library and command-line utility for Shodan 
(https://developer.shodan.io)
 Home-page: http://github.com/achillean/shodan-python/tree/master
 Author: John Matherly


Reply via email to