Browse Source

init extractor

liuyuqi-dellpc 1 year ago
parent
commit
247dbb3eb2

+ 35 - 1
README.md

@@ -1,3 +1,37 @@
 # crawl_secondhand
 
-二手商品监控
+二手商品监控。
+
+1、指定商品定时爬取,有新商品时发送邮件通知。
+2、比价,有新用户发布同样的商品时发送邮件通知。
+
+
+## Usage
+
+**Web版本**
+
+```
+python main.py server --config config.json
+
+```
+
+**GUI版本**
+
+```
+python main.py gui --config config.json
+```
+
+**命令行版本**
+
+```
+python main.py run --config config.json
+```
+
+## Develop
+
+
+**pip 包:**
+
+```
+python setup.py sdist bdist_wheel
+```

+ 7 - 0
crawl_secondhand/extractor/58.py

@@ -0,0 +1,7 @@
+class City58(object):
+    
+    def __init__(self):
+        pass
+
+if __name__ == "__main__":
+    pass

+ 0 - 0
crawl_secondhand/extractor/__init__.py


+ 8 - 0
crawl_secondhand/extractor/chen168.py

@@ -0,0 +1,8 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2023/09/23 00:36:57
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   二手车
+'''

+ 15 - 0
crawl_secondhand/extractor/dangdang.py

@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2023/09/23 00:37:11
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   当当二手书
+'''
+class Dangdang(object):
+    
+    def __init__(self):
+        pass
+
+if __name__ == "__main__":
+    pass

+ 15 - 0
crawl_secondhand/extractor/jindong.py

@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2023/09/23 00:35:48
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   京东
+'''
+class Jindong(object):
+    
+    def __init__(self):
+        pass
+
+if __name__ == "__main__":
+    pass

+ 16 - 0
crawl_secondhand/extractor/paipai.py

@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2023/09/23 00:38:32
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   拍拍
+'''
+
+class Paipai(object):
+    
+    def __init__(self):
+        pass
+
+if __name__ == "__main__":
+    pass

+ 16 - 0
crawl_secondhand/extractor/xianyu.py

@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2023/09/23 00:38:01
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   闲鱼
+'''
+
+class Xianyu(object):
+    
+    def __init__(self):
+        pass
+
+if __name__ == "__main__":
+    pass

+ 17 - 0
crawl_secondhand/extractor/zhuanzhuan.py

@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2023/09/23 00:37:45
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   
+
+'''
+
+class Zhuanzhuan(object):
+    
+    def __init__(self):
+        pass
+
+if __name__ == "__main__":
+    pass

+ 0 - 3
crawl_secondhand/paipai.py

@@ -3,6 +3,3 @@ class Paipai(Secondhand):
     ''' 京东拍拍二手商品 '''
     def __init__(self):
         pass
-
-if __name__ == "__main__":
-    pass

+ 0 - 3
crawl_secondhand/secondhand.py

@@ -12,6 +12,3 @@ class Secondhand(object):
     
     def __init__(self):
         pass
-
-if __name__ == "__main__":
-    pass

+ 0 - 0
crawl_secondhand/server/__init__.py


+ 17 - 1
main.py

@@ -7,5 +7,21 @@
 @Desc    :   enter point
 '''
 from crawl_secondhand import main
+import argparse
+
+parser = argparse.ArgumentParser(description='Crawl Secondhand')
+parser.add_argument('command', help='command to run')
+parser.add_argument('-l', '--log', help='log file path')
+
+
+
 if __name__=='__main__':
-    main()
+    args = parser.parse_args()
+    if args.command == 'server':
+        pass
+    elif args.command == 'gui':
+        pass
+    elif args.command == 'run':
+        main()
+    else:
+        parser.print_help()

+ 2 - 1
requirements.txt

@@ -1,2 +1,3 @@
 requests
-flask
+flask
+dotenv

+ 17 - 0
setup.py

@@ -0,0 +1,17 @@
+from setuptools import setup, find_packages
+
+with open('requirements.txt') as f:
+    requirements = f.read().splitlines()
+
+with open('README.md') as f:
+    readme = f.read()
+
+setup(
+    name='crawl_secondhand',
+    version='1.0.1',
+    description='二手商品监控',
+    long_description=readme,
+    author='liuyuqi',
+    author_email="liuyuqi.gov@msn.cn",
+    url='https://git.yoqi.me/lyq/crawl_secondhand',
+)