Codebase list emailharvester / 99139a7
github plugin added github plugin added maldevel 8 years ago
1 changed file(s) with 73 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 """
1 This file is part of EmailHarvester
2 Copyright (C) 2016 @maldevel
3 https://github.com/maldevel/EmailHarvester
4
5 EmailHarvester - A tool to retrieve Domain email addresses from Search Engines.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 For more see the file 'LICENSE' for copying permission.
21 """
22
23 #config = None
24 app_emailharvester = None
25
26
27 def search(domain, limit):
28 all_emails = []
29 app_emailharvester.show_message("\n[+] Searching in Github..\n")
30
31 app_emailharvester.show_message("\n[+] Searching in Yahoo + Github..\n")
32 yahooUrl = "http://search.yahoo.com/search?p=site%3Agithub.com+%40{word}&n=100&ei=UTF-8&va_vt=any&vo_vt=any&ve_vt=any&vp_vt=any&vd=all&vst=0&vf=all&vm=p&fl=0&fr=yfp-t-152&xargs=0&pstart=1&b={counter}"
33 app_emailharvester.init_search(yahooUrl, domain, limit, 1, 100)
34 app_emailharvester.process()
35 all_emails += app_emailharvester.get_emails()
36
37 app_emailharvester.show_message("\n[+] Searching in Bing + Github..\n")
38 bingUrl = "http://www.bing.com/search?q=site%3Agithub.com+%40{word}&count=50&first={counter}"
39 app_emailharvester.init_search(bingUrl, domain, limit, 0, 50)
40 app_emailharvester.process()
41 all_emails += app_emailharvester.get_emails()
42
43 app_emailharvester.show_message("\n[+] Searching in Google + Github..\n")
44 googleUrl = 'https://www.google.com/search?num=100&start={counter}&hl=en&q=site%3Agithub.com+"%40{word}"'
45 app_emailharvester.init_search(googleUrl, domain, limit, 0, 100)
46 app_emailharvester.process()
47 all_emails += app_emailharvester.get_emails()
48
49 app_emailharvester.show_message("\n[+] Searching in Baidu + Github..\n")
50 url = 'http://www.baidu.com/search/s?wd=site%3Agithub.com+"%40{word}"&pn={counter}'
51 app_emailharvester.init_search(url, domain, limit, 0, 10)
52 app_emailharvester.process()
53 all_emails += app_emailharvester.get_emails()
54
55 app_emailharvester.show_message("\n[+] Searching in Exalead + Github..\n")
56 url = "http://www.exalead.com/search/web/results/?q=site%3Agithub.com+%40{word}&elements_per_page=10&start_index={counter}"
57 app_emailharvester.init_search(url, domain, limit, 0, 50)
58 app_emailharvester.process()
59 all_emails += app_emailharvester.get_emails()
60
61 #dogpile seems to not support site:
62
63 return all_emails
64
65
66 class Plugin:
67 def __init__(self, app, conf):#
68 global app_emailharvester, config
69 #config = conf
70 app.register_plugin('github', {'search': search})
71 app_emailharvester = app
72