├── __init__.py
├── bot
├── __init__.py
├── job.py
└── main.py
├── screen.png
├── .gitignore
├── web
├── images
│ ├── load.gif
│ └── logo-27.png
├── css
│ ├── main.min.css
│ └── main.css
├── index.html
└── js
│ ├── main.min.js
│ └── main.js
├── config.example.txt
├── requirements.txt
├── setup_api.py
├── README.md
├── lang
├── en.json
└── fr.json
└── api
└── main.py
/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bot/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sanix-Darker/FlashIt/HEAD/screen.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | flashit.db
2 | *config.txt
3 | logs.log
4 | .vscode
5 | .history
6 | *__pycache__
--------------------------------------------------------------------------------
/web/images/load.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sanix-Darker/FlashIt/HEAD/web/images/load.gif
--------------------------------------------------------------------------------
/config.example.txt:
--------------------------------------------------------------------------------
1 | [flashitbot-config]
2 | Token = ----------------
3 | Googlemapkey = ----------------
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | bs4
2 | flask
3 | requests
4 | #setuptools
5 | python-telegram-bot
6 | configparser
--------------------------------------------------------------------------------
/web/images/logo-27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sanix-Darker/FlashIt/HEAD/web/images/logo-27.png
--------------------------------------------------------------------------------
/setup_api.py:
--------------------------------------------------------------------------------
1 | __author__ = 'Sanix darker'
2 |
3 |
4 | import sys
5 | from glob import glob # glob will help us search for files based on their extension or filename.
6 | from distutils.core import setup # distutils sends the data py2exe uses to know which file compile
7 | import py2exe
8 |
9 | data_files = []
10 | setup(
11 | name='FlashIt',
12 | console=['./api/main.py'], # 'windows' means it's a GUI, 'console' It's a console program, 'service' a Windows' service, 'com_server' is for a COM server
13 | # You can add more and py2exe will compile them separately.
14 | options={ # This is the list of options each module has, for example py2exe, but for example, PyQt or django could also contain specific options
15 | 'py2exe': {
16 | 'packages':['jinja2'],
17 | 'dist_dir': 'dist', # The output folder
18 | 'compressed': True, # If you want the program to be compressed to be as small as possible
19 | 'includes':['bs4', 'requests','hashlib', 'datetime', 'flask'], # All the modules you need to be included, because py2exe guesses which modules are being used by the file we want to compile, but not the imports
20 | }
21 | },
22 | data_files=data_files # Finally, pass the
23 | )
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Flashit
4 |
5 | A nice system to be notify when there is soldes on products.
6 |
7 | ### IMPORTANT NOTE
8 |
9 | - This source code is only for Educational purpose, am not responsible of the bas use of this code.
10 | - This project is not yet running Online!
11 |
12 | ## Features
13 |
14 | - A search engine.
15 | - A chat bot.
16 | - A background Job that fetch your requests.
17 |
18 | ## How to deploy
19 |
20 | ```shell
21 | # Install requirements
22 | pip install -r requirements.txt
23 |
24 | # Create your telegram Bot and it's API
25 |
26 | # Start the api in a new tab
27 | python ./api/main.py
28 |
29 | # Start the job in a new tab
30 | python ./bot/job.py
31 |
32 | # Configure your Config file
33 | # Rename config.example by config.txt
34 |
35 | # Start the Telegram Bot in a new tab
36 | python ./bot/main.py
37 |
38 | # Now open the html file for the IHM view available here: ./web/index.html
39 |
40 | # annnndd that's all... i gues! Create anissue if you need more answer!
41 |
42 | ```
43 |
44 | ## DEMO
45 |
46 | - See a full test on [Youtube](https://www.youtube.com/watch?v=PrbXV9MFuto)
47 |
48 | ## Rendering
49 |
50 |
51 |
52 |
53 | ### MIT LICENSE
54 |
55 |
56 | ## Author
57 |
58 | - Sanix darker
59 |
--------------------------------------------------------------------------------
/lang/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "WELCOME_MESSAGE":"Welcome to Flashit! \n\nTo start, do a search on FlashIt engine, if you get any good results, copy the code left on the search bar and paste it here, i will notify you if there is new results for you! \n\nHit /help to learn more on how to use Flashit.",
3 | "WAIT_MESSAGE": "Wait few seconds, Flashit is processing...",
4 | "GIVE_LOCATION_MESSAGE": "Mind give me your location?\nPlease make sure you have Enable the Location in your device!",
5 | "SEND_LOCATION_MESSAGE_RESPONSE": "Your localisation have been updated:\nAddress: {}\nLongitude: {}, Latitude: {}",
6 | "GIVE_CONTACT_MESSAGE": "Mind give me your contact?",
7 | "SEND_CONTACT_MESSAGE_RESPONSE": "Your contact has been updated:\nContact: {}",
8 | "SHARE_LOCATION_MESSAGE": "Hi!\n Click here to share your location",
9 | "SHARE_CONTACT_MESSAGE": "Hi!\n Click here to share your contact",
10 | "HELP_MESSAGE" : "Hi, here's how to use Flashit Bot: \n\n> /start - For the presentation of Flashit. \n> /help - To get more explanation of how to use it. \n\nIf you still have a problem, please contact the developer @sanixdarker.",
11 | "REQUEST_TOO_LONG": "Your request is too long, reduce it!",
12 | "OUPS_URL_MESSAGE": "Oups! An error occured with your code(allready used or not valid):",
13 | "CODE_SAVED_MESSAGE": "Your code have been saved successfully, you will be notify soon for this request !"
14 | }
--------------------------------------------------------------------------------
/lang/fr.json:
--------------------------------------------------------------------------------
1 | {
2 | "WELCOME_MESSAGE":"Bienvenue sur Flashit! \n\n Pour commencer, effectuez une recherche sur le moteur FlashIt. Si vous obtenez de bons résultats, copiez le code restant dans la barre de recherche et collez-le ici. Je vous préviendrai s'il y a de nouveaux résultats pour vous! \n\n Hit /help pour en savoir plus sur l’utilisation de Flashit.",
3 | "WAIT_MESSAGE": "Attendez quelques secondes, Flashit est en train de traiter ...",
4 | "GIVE_LOCATION_MESSAGE": "Souhaitez-vous me donner votre emplacement? \n Assurez-vous d’avoir activé l’emplacement dans votre appareil!",
5 | "SEND_LOCATION_MESSAGE_RESPONSE": "Votre localisation a été mise à jour: \nAdresse: {} \nLongitude: {}, Latitude: {}.",
6 | "GIVE_CONTACT_MESSAGE": "Souhaitez-vous me donner votre contact?",
7 | "SEND_CONTACT_MESSAGE_RESPONSE": "Votre contact a été mis à jour: \n Contact: {}",
8 | "SHARE_LOCATION_MESSAGE": "Hello!\n Clic ici pour envoyer ta localisation",
9 | "SHARE_CONTACT_MESSAGE": "Hello!\n Clic ici pour envoyer ton contact",
10 | "HELP_MESSAGE" : "Salut, voici comment utiliser Flashit Bot: \n\n> /start - Pour la présentation de Flashit. \n> /help - Pour obtenir encore plus d'informations. \n\nSi vous rencontrez toujours un problème, veuillez contacter le développeur @sanixdarker.",
11 | "REQUEST_TOO_LONG": "Votre demande est trop longue, réduisez-la!",
12 | "OUPS_URL_MESSAGE": "Oops! Une erreur est survenue avec votre code(Deja en attente ou non valide).",
13 | "CODE_SAVED_MESSAGE": "Votre code a été enregistré avec succès, vous serez notifié bientôt pour cette recherche!"
14 | }
--------------------------------------------------------------------------------
/bot/job.py:
--------------------------------------------------------------------------------
1 | import time
2 | import random
3 | import json
4 | import sqlite3
5 | import requests
6 | from main import message_user
7 |
8 |
9 | print("[+] --------------------------------------")
10 | print("[+] Flashit Job started...")
11 | print("[+] --------------------------------------")
12 |
13 | while True:
14 | rand = random.randint(100, 500)
15 | print ("[+] rand: ", rand)
16 | time.sleep(rand)
17 | conn = sqlite3.connect('./flashit.db')
18 | cur = conn.cursor()
19 | cur.execute("SELECT * FROM flash")
20 | rows3 = cur.fetchall()
21 |
22 | for row in rows3:
23 | code, chatid, cur = row[1], row[0], conn.cursor()
24 | cur.execute("SELECT * FROM ping WHERE code = ?", (row[1],))
25 | rowsy = cur.fetchall()
26 | r_json = {}
27 | #print("[+] rowsy: ", rowsy)
28 | if (len(rowsy) > 0):
29 | for rowy in rowsy:
30 | #print("rowy: ", rowy)
31 | r_json = {
32 | "status": "success",
33 | "code": code,
34 | "chatid": chatid,
35 | "percent": rowy[1],
36 | "price": rowy[2],
37 | "search": rowy[3],
38 | "not_contain": rowy[5],
39 | "must_contain": rowy[6],
40 | "category": rowy[7]
41 | }
42 | #print('r_json["search"].split("?q=")[1]: ', r_json["search"].split("?q=")[1])
43 | r = requests.get(
44 | "http://127.0.0.1:7777/flash?job=yes&find="+
45 | r_json["search"].split("?q=")[1]+
46 | "&percent="+str(r_json["percent"])+
47 | "&level=20"+
48 | "&price="+str(r_json["price"])+
49 | "¬_contain="+str(r_json["not_contain"])+
50 | "&must_contain="+str(r_json["must_contain"])+
51 | "&category="+str(r_json["category"])+
52 | "&host="+r_json["search"].split("/catalog/?q=")[0]
53 | )
54 | ri = r.json()
55 |
56 | #print("[+] ri: ", ri)
57 |
58 | if (len(ri["results"]) > 0):
59 | message = ""
60 | not_contain = str(r_json["not_contain"]).split(",")
61 | must_contain = str(r_json["must_contain"]).split(",")
62 | for res in ri["results"]:
63 |
64 |
65 | if( not any(ext.lower() in res["title"].lower() for ext in not_contain) and
66 | any(ext.lower() in res["title"].lower() for ext in must_contain)):
67 |
68 | value = "< "+str(res['price'])+" F"
69 | if res['price'] == 0:
70 | value = "- "+str(res['percent'])+" %"
71 |
72 | message += "> [ "+value+" ] "+ res["title"] + "\n"+ res["href"]+"\n\n"
73 | else:
74 | print("[+] must_contain: {} and not_contain: {} rejections: ".format(must_contain, not_contain))
75 |
76 | if (len(message) > 5 and
77 | not any(ext.lower() in message.lower() for ext in not_contain) and
78 | any(ext.lower() in message.lower() for ext in must_contain)):
79 | print("[+] message: ", message)
80 | print(message_user(r_json["chatid"], str("Results for "+code+": \n"+str(message))))
81 | cur.execute("DELETE FROM ping WHERE code = ?", (row[1],))
82 | cur.execute("DELETE FROM flash WHERE code = ?", (row[1],))
83 | conn.commit()
84 | cur.close()
85 |
86 | else:
87 | r_json["status"] = "error"
88 |
89 | print("[+] r_json: ", r_json)
--------------------------------------------------------------------------------
/web/css/main.min.css:
--------------------------------------------------------------------------------
1 | html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}html{height:100%}fieldset{margin:0;padding:0;-webkit-margin-start:0;-webkit-margin-end:0;-webkit-padding-before:0;-webkit-padding-start:0;-webkit-padding-end:0;-webkit-padding-after:0;border:0}legend{margin:0;padding:0;display:block;-webkit-padding-start:0;-webkit-padding-end:0}*{box-sizing:border-box}.s007{min-height:100vh;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background:#00b5e9;padding:15px;font-family:Roboto,sans-serif}.s007 form{width:100%;max-width:790px;margin:0}.s007 form .inner-form{width:100%}.s007 form .inner-form .input-field{position:relative}.s007 form .inner-form .input-field input{height:100%;border:0;background:#fff;display:block;width:100%;padding:10px 32px 10px 70px;font-size:18px;color:#666;border-radius:3px;height:70px;color:#555}.s007 form .inner-form .input-field input.placeholder{color:#999;font-size:18px}.s007 form .inner-form .input-field input:-moz-placeholder{color:#999;font-size:18px}.s007 form .inner-form .input-field input::-webkit-input-placeholder{color:#999;font-size:18px}.s007 form .inner-form .input-field input:focus,.s007 form .inner-form .input-field input:hover{box-shadow:none;outline:0}.s007 form .inner-form .input-field .btn-search{min-width:100px;height:40px;padding:0 15px;background:#57b846;white-space:nowrap;border-radius:3px;font-size:14px;color:#fff;transition:all .2s ease-out,color .2s ease-out;border:0;cursor:pointer;font-weight:700}.s007 form .inner-form .input-field .btn-search:hover{background:#4ea63f}.s007 form .inner-form .input-field .btn-delete{min-width:100px;height:40px;padding:0 15px;background:0 0;white-space:nowrap;border-radius:3px;font-size:14px;color:#555;transition:all .2s ease-out,color .2s ease-out;border:0;cursor:pointer;font-weight:700}.s007 form .inner-form .input-field .btn-delete:hover{color:#000}.s007 form .inner-form .basic-search{margin-bottom:5px;box-shadow:0 8px 20px 0 rgba(0,0,0,.15)}.s007 form .inner-form .basic-search .input-field{width:100%}.s007 form .inner-form .basic-search .input-field input{padding:10px 110px 10px 70px}.s007 form .inner-form .basic-search .input-field .icon-wrap{position:absolute;top:0;left:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;-ms-flex-align:center;align-items:center;width:60px;height:100%}.s007 form .inner-form .basic-search .input-field .icon-wrap svg{width:34px;height:34px;fill:#ccc}.s007 form .inner-form .basic-search .input-field .result-count{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;width:110px;top:0;right:0;position:absolute;font-weight:700;color:#555;height:100%;font-size:14px}.s007 form .inner-form .basic-search .input-field .result-count span{color:#57b846;padding-right:5px}.s007 form .inner-form .advance-search{background:#fff;padding:40px;border-radius:3px;box-shadow:0 8px 20px 0 rgba(0,0,0,.15)}.s007 form .inner-form .advance-search .desc{font-size:15px;color:#999;display:block;margin-bottom:26px}.s007 form .inner-form .advance-search .row{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:20px}.s007 form .inner-form .advance-search .row.second{margin-bottom:46px}.s007 form .inner-form .advance-search .row.third{margin-bottom:0}.s007 form .inner-form .advance-search .input-field{width:calc(33.3333% - 30px)}.s007 form .inner-form .advance-search .input-select{height:40px}.s007 form .inner-form .basic-search .input-field input{padding:10px 110px 10px 60px}.s007 form .inner-form .basic-search .input-field .icon-wrap{width:60px;-ms-flex-pack:center;justify-content:center}.s007 form .inner-form .basic-search .input-field .icon-wrap svg{width:26px;height:26px}.s007 form .inner-form .advance-search .row{display:block}.s007 form .inner-form .advance-search .input-field{width:100%;margin-bottom:20px}#titre{font-size:45px;color:#fff;margin-bottom:-12px;text-shadow:0 3px 5px rgba(0,0,0,.45);margin-left:-3px}#author{text-shadow:0 3px 4px rgba(0,0,0,.45);position:fixed;bottom:7px;right:8px;font-size:10px}#author img{box-shadow:0 3px 4px rgba(0,0,0,.45);border-radius:100%;width:30%}#author a{color:#000;text-decoration:none}a.result{color:#000;text-decoration:none;transition:all .4s}a.result:hover{color:#00b5e9;transition:all .4s}select{width:100%;padding:10px;background:#fff;border:1px solid rgba(0,0,0,.15)}span.label{font-size:13px}
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Flash It
11 |
12 |
13 |
149 |
150 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/api/main.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 | # main.py the api core
3 | # Created by S4n1x-d4rk3r
4 |
5 | from bs4 import BeautifulSoup
6 | from flask import Flask, jsonify, request
7 | import requests, sqlite3
8 | from hashlib import md5
9 | from datetime import datetime
10 | import time
11 |
12 | conn = sqlite3.connect('./flashit.db')
13 | c = conn.cursor()
14 | c.execute('create table if not exists ping (code string, percent string, price string, search string, _date string, not_contain string, must_contain string, category string)')
15 | conn.commit()
16 | c.close()
17 |
18 | app = Flask(__name__)
19 | app.config['Secret'] = "Secret"
20 |
21 | def getElts(html):
22 | #r = requests.get("http://" +url)
23 | data = html.text
24 | soup = BeautifulSoup(data, features="lxml")
25 | list_results = soup.find_all("a", {"class": "link"})
26 | return list_results
27 |
28 | def only_numbers(string_):
29 | if string_ == None:
30 | return "0"
31 | else:
32 | return ''.join([i for i in string_ if i.isdigit()])
33 |
34 | def MD5(block_string):
35 | return md5(block_string.encode()).hexdigest()
36 |
37 | @app.route('/', methods=['GET']) # To prevent Cors issues
38 | def index1():
39 | # Sent in GET requests
40 | # Build the response
41 | response = jsonify({ 'status':'success', 'message': 'Welcome to Flash API.' })
42 | # Let's allow all Origin requests
43 | response.headers.add('Access-Control-Allow-Origin', '*') # To prevent Cors issues
44 | return response
45 |
46 | @app.route('/flash', methods=['GET']) # To prevent Cors issues
47 | def index2():
48 | # Let's protect the main api from crashing
49 | #try:
50 | print("[+] Fetching results...")
51 | # Sent in GET requests
52 | host = request.args.get('host')
53 | find = str(request.args.get('find')).replace(" ", "+")
54 |
55 | try: percent = request.args.get('percent')
56 | except Exception as es: percent = "0"
57 |
58 | try: level = int(request.args.get('level'))
59 | except Exception as es: level = 5
60 |
61 | try: category = request.args.get('category')
62 | except Exception as es: category = "0"
63 |
64 | try: price = request.args.get('price')
65 | except Exception as es: price = "0"
66 |
67 | try: job = request.args.get('job')
68 | except Exception as es: job = None
69 |
70 | not_contain = request.args.get('not_contain').split(",")
71 | must_contain = request.args.get('must_contain').split(",")
72 |
73 | print("[+] not_contain: ", not_contain)
74 | print("[+] must_contain: ", must_contain)
75 |
76 | code = ""
77 | results_size = 0
78 | json_results = []
79 | percent_classes = ["sale-flag-percent"]
80 | price_classes = ["price"]
81 | for i in range(1, level):
82 | time.sleep(1)
83 | search = host+"/catalog/?q="+find+"&page="+str(i)
84 | if category != "0": search = category.replace("https://www.jumia.cm", host+"/")+"&page="+str(i)
85 |
86 | print("[+] search: ", search)
87 | results = getElts(requests.get(search))
88 | results_size += len(results)
89 | for result in results:
90 | print("[+] ---------------------------------- ")
91 | print("[+] - Href: "+result["href"])
92 | children = result.findChildren("span" , recursive=True)
93 | for child in children:
94 | try:
95 |
96 | # print("[+] result.text: ", result.text)
97 | # print("[+] price: ", price)
98 | # print("[+] percent: ", percent)
99 | # print("[+] child['class'][0]: ", child['class'][0])
100 | # print("[+] percent_classes: ", percent_classes)
101 | # print("[+] child['class'][0] in percent_classes: ", (child["class"][0] in percent_classes))
102 | # print("[+] float(percent): ", float(percent))
103 | # print("[+] child.text: ", child.text)
104 | # print("[+] (only_numbers(child.text)): ", (only_numbers(child.text)))
105 | # print("[+] float(only_numbers(child.text)): ", float(only_numbers(child.text)))
106 | # print("[+] any(ext.lower() in result.text.lower() for ext in not_contain): ", any(ext.lower() in result.text.lower() for ext in not_contain))
107 |
108 | if (
109 | price == "0" and percent != "0" and
110 | child["class"][0] in percent_classes and
111 | float(percent) <= float(only_numbers(child.text)) and
112 | not any(ext.lower() in result.text.lower() for ext in not_contain) and
113 | any(ext.lower() in result.text.lower() for ext in must_contain)):
114 |
115 | json_results.append({
116 | "title": str(result.text),
117 | "href": str(result["href"]),
118 | "percent": float(only_numbers(child.text)),
119 | "price": 0
120 | })
121 |
122 | elif(
123 | price != "0" and percent == "0" and
124 | child["class"][0] == "price" and
125 | "-old" not in child["class"] and
126 | not any(ext.lower() in result.text.lower() for ext in not_contain) and
127 | any(ext.lower() in result.text.lower() for ext in must_contain)):
128 |
129 | product_price = int(child.findChildren("span" , recursive=True)[0]["data-price"])
130 |
131 | if (
132 | child["class"][0] in price_classes and
133 | float(price.split("-")[1]) > float(product_price)):
134 |
135 | json_results.append({
136 | "title": str(result.text),
137 | "href": str(result["href"]),
138 | "percent": 0,
139 | "price": product_price
140 | })
141 |
142 | elif(price == "0" and percent == "0" and
143 | not any(ext.lower() in result.text.lower() for ext in not_contain) and
144 | any(ext.lower() in result.text.lower() for ext in must_contain)):
145 |
146 | json_results.append({
147 | "title": str(result.text),
148 | "href": str(result["href"]),
149 | "percent": 0,
150 | "price": int(child.findChildren("span" , recursive=True)[0]["data-price"])
151 | })
152 | except Exception as es: pass
153 | i = i + 1
154 |
155 | json_results = sorted(json_results, key=lambda k: k['price'])[::-1]
156 | if price == "0": json_results = sorted(json_results, key=lambda k: k['percent'])[::-1]
157 |
158 | if (len(json_results) == 0 and job == None):
159 | must_contain = ','.join(must_contain)
160 | not_contain = ','.join(not_contain)
161 | code = str(MD5(search))[:10]
162 | _date = (str(datetime.now())).split('.')[0]
163 | print("[+] > code:{}, percent:{}, search:{}, date:{}, not_contain:{}, must_contain:{}, category:{}".format(code, percent, search.split("&")[0], _date, not_contain, must_contain, category))
164 | conn = sqlite3.connect('./flashit.db')
165 | c = conn.cursor()
166 | c.execute('INSERT INTO ping VALUES (?,?,?,?,?,?,?,?)', (code, percent, price, search.split("&")[0], _date, not_contain, must_contain, category))
167 | conn.commit()
168 | c.close()
169 | # Build the response
170 | response = jsonify({'status':'success', 'code':code, 'fetched': str(results_size)+' fetched', 'filtered': str(len(json_results))+' filtered', "results": json_results })
171 | # except Exception as es:
172 | # print("[+] Oups, some error occurs!", str(es))
173 | # response = jsonify({'status':'error', 'message':"Your request cause an unexcepted error on the server"})
174 |
175 | # Let's allow all Origin requests
176 | response.headers.add('Access-Control-Allow-Origin', '*') # To prevent Cors issues
177 | return response
178 |
179 | if __name__ == "__main__":
180 | app.run(host='0.0.0.0', debug=True, port=7777)
--------------------------------------------------------------------------------
/bot/main.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # coding=utf-8
3 |
4 | # FlashIt Bot
5 | # main.py
6 | # Made by S@n1X-d4rk3r
7 | # This is the core where anything is done
8 |
9 | from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler, RegexHandler, ConversationHandler
10 | from telegram import InlineKeyboardButton, InlineKeyboardMarkup
11 | from telegram import KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove
12 |
13 | import logging
14 | from datetime import datetime
15 | import sqlite3
16 | import configparser as ConfigParser
17 | import json
18 | import os
19 | import requests
20 |
21 | conn = sqlite3.connect('./flashit.db')
22 | c = conn.cursor()
23 | c.execute('create table if not exists flash (chatid string, code string, username string, _date string)')
24 | conn.commit()
25 | c.close()
26 |
27 | with open('logs.log', 'w') as fill:
28 | fill.write(".")
29 |
30 | # Let's instantiate the database if it's not exist
31 | # if
32 |
33 | # Create a custom logger
34 | logger = logging.getLogger(__file__)
35 | logger.setLevel(logging.INFO)
36 | # Create handlers
37 | f_handler = logging.FileHandler('logs.log')
38 | # Create formatters and add it to handlers
39 | f_format = logging.Formatter(' %(asctime)s > %(process)d-%(levelname)s-%(message)s')
40 | f_handler.setFormatter(f_format)
41 | # Add handlers to the logger
42 | logger.addHandler(f_handler)
43 |
44 | separator = "# -------------------------------------------------------------"
45 |
46 | # Configs parameters configParser.get('your-config', 'path1')
47 | configParser = ConfigParser.RawConfigParser()
48 | configFilePath = r'config.txt'
49 | configParser.read(configFilePath)
50 | # Configs parameters
51 | TOKEN = configParser.get('flashitbot-config', 'token')
52 |
53 |
54 | thebot = None
55 |
56 | # Lang management
57 | def get_lang_string_by_code(lang_code, code):
58 | with open('lang/'+lang_code+'.json', 'r+', encoding='utf-8') as f:
59 | lang_string = json.load(f)
60 | return lang_string[code]
61 |
62 | def presentation():
63 | #os.system("clear")
64 | print(separator)
65 | print("[+] # ----------------- Flashitbot Started! -------------------------")
66 | print(separator)
67 | print("[+] # By 🐼Sanix darker")
68 | print(separator)
69 |
70 | # To print a log and save it in logs.log
71 | def printLog(command, Telegram_user):
72 | tolog = command + " by: first_name: {}, last_name: {}, username: {}, language_code: {}, is_bot: {}".format(str(Telegram_user.first_name), str(Telegram_user.last_name), str(Telegram_user.username), str(Telegram_user.language_code), str(Telegram_user.is_bot))
73 | #logger.info(tolog)
74 | print(tolog)
75 |
76 | # To rejects other bots that wanted to querry JeveuBot
77 | def reject_bots(bot, update):
78 | #global thebot
79 | #thebot = bot
80 | if(update.message.from_user.is_bot == True):
81 | logger.info(("OUPS BOT, not authorized here!"))
82 | bot.send_message(chat_id=update.message.chat_id,
83 | text="NOT AUTHORIZED")
84 | return False
85 |
86 | return True
87 |
88 | # ---------------------------------------------
89 | # -----------COMMAND CALLBACK -----------------
90 | # ---------------------------------------------
91 | # message = telegram.Message(
92 | # message_id=0,
93 | # from_user=telegram.User(0, 'greenkey'),
94 | # date=datetime.now(),
95 | # chat=telegram.Chat(0, ''),
96 | # text=message_text
97 | # )
98 | # define a command callback function : /start
99 | def start_callback(bot, update):
100 | #global thebot
101 | #thebot = bot
102 | lang_code = update.message.from_user.language_code
103 | print(separator)
104 | printLog("command: /start ",update.message.from_user)
105 | bot.send_message(chat_id=update.message.chat_id,
106 | text="Hello " + str(update.message.from_user.first_name) + " " + str(update.message.from_user.last_name))
107 | # profil, options, help, add, revoke, news, complex search
108 | if(reject_bots(bot, update) == True):
109 | bot.send_message(chat_id=update.message.chat_id,
110 | text=get_lang_string_by_code(lang_code, "WELCOME_MESSAGE"))
111 |
112 | # Handler
113 | start_handler = CommandHandler("start", start_callback)
114 |
115 |
116 | # The Help function
117 | def help_callback(bot, update):
118 | #global thebot
119 | #thebot = bot
120 | lang_code = update.message.from_user.language_code
121 |
122 | print(separator)
123 | printLog("command: /help ",update.message.from_user)
124 | if(reject_bots(bot, update) == True):
125 | bot.send_message(chat_id=update.message.chat_id,
126 | text=get_lang_string_by_code(lang_code, "HELP_MESSAGE"))
127 | # Handler
128 | help_handler = CommandHandler("help", help_callback)
129 |
130 |
131 | # def handle_message(bot, update):
132 | # text = update.message.text
133 | # if text == 'hello':
134 | # update.message.reply_text('Hello {}'.format(update.message.from_user.first_name))
135 |
136 | # dispatcher.add_handler(MessageHandler(filters=Filters.text, callback=handle_message))
137 |
138 |
139 | # To send messageto some one init's Telegram
140 | def message_user(chatid, message):
141 | # global thebot
142 | # thebot.send_message(chat_id=chatid,
143 | # text=message)
144 | payload = {
145 | 'chat_id': chatid,
146 | 'text': message
147 | }
148 | return requests.post("https://api.telegram.org/bot{token}/sendMessage".format(token=TOKEN),
149 | data=payload).content
150 |
151 | # ---------------------------------------------
152 | # -----------TEXT CALLBACK -----------------
153 | # ---------------------------------------------
154 | # define a command callback function : avion noir
155 | # Rake is for cleaning unnusual words
156 | # import rake
157 |
158 | def echo_callback(bot, update):
159 | #global thebot
160 | #thebot = bot
161 | lang_code = str(update.message.from_user.language_code)
162 |
163 | print(separator)
164 | print("[+] Request: ",update.message.from_user)
165 | code = str(update.message.text)
166 | chatid = str(update.message.chat_id)
167 |
168 | if(reject_bots(bot, update) == True):
169 | if (len(code) > 15):
170 | bot.send_message(chat_id=update.message.chat_id,
171 | text=get_lang_string_by_code(lang_code, "REQUEST_TOO_LONG"))
172 | else:
173 | # correct_sentence = CorrectSentence(lang_code, to_find)
174 | # print("[+] Message: " , correct_sentence)
175 | # print ("keywords: ", rake.clean(to_find, "./data/erase_word_list_"+lang_code+".txt"))
176 |
177 | # bot.send_message(chat_id=update.message.chat_id,
178 | # disable_notification = True,
179 | # text="🤖# {}".format(get_lang_string_by_code(lang_code, "WAIT_MESSAGE")))
180 |
181 | # On peut enchainer les lien avec des ','
182 | r_json = {}
183 |
184 | conn = sqlite3.connect('./flashit.db')
185 | cur = conn.cursor()
186 |
187 | cur.execute("SELECT * FROM flash WHERE code = ?", (code,))
188 | rows2 = cur.fetchall()
189 |
190 | if (len(rows2) > 0):
191 | r_json["status"] = "error"
192 | else:
193 | cur = conn.cursor()
194 | cur.execute("SELECT * FROM ping WHERE code = ?", (code,))
195 | rows = cur.fetchall()
196 | #print("[+] rows: ", rows)
197 | if (len(rows) > 0):
198 | for row in rows:
199 | r_json = {
200 | "status": "success",
201 | "code": row[0],
202 | "href": row[2],
203 | "percent": row[1],
204 | "price": row[2]
205 | }
206 | else:
207 | r_json["status"] = "error"
208 |
209 | #print("[+] r_json: ", r_json)
210 | if r_json["status"] == "success":
211 | _date, c = (str(datetime.now())).split('.')[0], conn.cursor()
212 |
213 | c.execute('INSERT INTO flash VALUES (?,?,?,?)', (chatid, code, update.message.from_user.username, _date))
214 | conn.commit()
215 | c.close()
216 |
217 | #print("[+] ------------------\nCode: "+r_json["code"]+"!\nLink: "+r_json["href"] + " \n-" + str(r_json["percent"]) + "%\n\n"+get_lang_string_by_code(lang_code, "CODE_SAVED_MESSAGE")+"\n------------------")
218 | bot.send_message(chat_id=update.message.chat_id,
219 | text = "-----------------------------------------\nCode: "+r_json["code"]+"!\nLink: "+r_json["href"] + "\n\n"+get_lang_string_by_code(lang_code, "CODE_SAVED_MESSAGE")+"\n-----------------------------------------")
220 | else:
221 |
222 | bot.send_message(chat_id=update.message.chat_id,
223 | text="🤖# {} {}".format(get_lang_string_by_code(lang_code, "OUPS_URL_MESSAGE"), code))
224 |
225 | print("[+] Response sent successfully!")
226 |
227 | # Create a command handler
228 | echo_handler = MessageHandler(Filters.text, echo_callback)
229 | # ---------------------------------------------
230 | # ------- BUTTON / MENU CALLBACK ------------
231 | # ---------------------------------------------
232 | # Managing Buttons Menu
233 | def menu_callback(bot, update):
234 | #global thebot
235 | #thebot = bot
236 | lang_code = update.message.from_user.language_code
237 | button = [
238 | [
239 | InlineKeyboardButton("Profil", callback_data="profil"),
240 | InlineKeyboardButton("Options", callback_data="options"),
241 | InlineKeyboardButton("help", callback_data="help")
242 | ],
243 | [
244 | InlineKeyboardButton("add", callback_data="add"),
245 | InlineKeyboardButton("revoke", callback_data="revoke")
246 | ],
247 | [InlineKeyboardButton("news", callback_data="news")]
248 | ]
249 | reply_markup = InlineKeyboardMarkup(button)
250 | if(reject_bots(bot, update) == True):
251 | bot.send_message(chat_id=update.message.chat_id,
252 | text="Welcome to jeveu menu, please Choose something...",
253 | reply_markup=reply_markup)
254 | menu_handler = CommandHandler("menu", menu_callback)
255 |
256 | def error(bot, update, error):
257 | #global thebot
258 | #thebot = bot
259 | """Log Errors caused by Updates."""
260 | logger.warning('Update "%s" caused error "%s"', update, error)
261 |
262 |
263 | def main():
264 | # Starting with the presentation
265 | presentation()
266 |
267 | # Cheker for new messages from elegram API -> polling
268 | updater = Updater(token=TOKEN)
269 | # Allow us to register handlers -> command, text, video, audio, etc
270 | dispatcher = updater.dispatcher
271 |
272 | # Add a command handler for dispatcher
273 | dispatcher.add_handler(start_handler)
274 |
275 | # Add a command handler for dispatcher
276 | dispatcher.add_handler(help_handler)
277 |
278 | # Add a command handler for dispatcher
279 | #dispatcher.add_handler(image_handler)
280 |
281 | # Add a text handler for dispatcher
282 | dispatcher.add_handler(echo_handler)
283 |
284 | # Options handler on dispatcher
285 | dispatcher.add_handler(menu_handler)
286 | # Button handler After clikc on a menu
287 | #dispatcher.add_handler(button_handler)
288 |
289 | # log all errors
290 | dispatcher.add_error_handler(error)
291 |
292 | # Start the Bot
293 | updater.start_polling()
294 |
295 | # Run the bot until you press Ctrl-C or the process receives SIGINT,
296 | # SIGTERM or SIGABRT. This should be used most of the time, since
297 | # start_polling() is non-blocking and will stop the bot gracefully.
298 | updater.idle()
299 |
300 | if __name__ == '__main__':
301 | main()
--------------------------------------------------------------------------------
/web/css/main.css:
--------------------------------------------------------------------------------
1 | html {
2 | line-height: 1.15;
3 | /* 1 */
4 | -ms-text-size-adjust: 100%;
5 | /* 2 */
6 | -webkit-text-size-adjust: 100%;
7 | /* 2 */
8 | }
9 |
10 | /* Sections
11 | ========================================================================== */
12 | /**
13 | * Remove the margin in all browsers (opinionated).
14 | */
15 | body {
16 | margin: 0;
17 | }
18 |
19 |
20 | /**
21 | * Correct the font size and margin on `h1` elements within `section` and
22 | * `article` contexts in Chrome, Firefox, and Safari.
23 | */
24 | h1 {
25 | font-size: 2em;
26 | margin: 0.67em 0;
27 | }
28 |
29 | /* Grouping content
30 | ========================================================================== */
31 | /**
32 | * Add the correct display in IE 9-.
33 | * 1. Add the correct display in IE.
34 | */
35 | figcaption,
36 | figure,
37 | main {
38 | /* 1 */
39 | display: block;
40 | }
41 |
42 | /**
43 | * Add the correct margin in IE 8.
44 | */
45 | figure {
46 | margin: 1em 40px;
47 | }
48 |
49 | /* Text-level semantics
50 | ========================================================================== */
51 | /**
52 | * 1. Remove the gray background on active links in IE 10.
53 | * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
54 | */
55 | a {
56 | background-color: transparent;
57 | /* 1 */
58 | -webkit-text-decoration-skip: objects;
59 | /* 2 */
60 | }
61 |
62 | /**
63 | * 1. Remove the bottom border in Chrome 57- and Firefox 39-.
64 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
65 | */
66 | abbr[title] {
67 | border-bottom: none;
68 | /* 1 */
69 | text-decoration: underline;
70 | /* 2 */
71 | text-decoration: underline dotted;
72 | /* 2 */
73 | }
74 |
75 | /**
76 | * Remove the border on images inside links in IE 10-.
77 | */
78 | img {
79 | border-style: none;
80 | }
81 |
82 | /**
83 | * Hide the overflow in IE.
84 | */
85 | svg:not(:root) {
86 | overflow: hidden;
87 | }
88 |
89 | /* Forms
90 | ========================================================================== */
91 | /**
92 | * 1. Change the font styles in all browsers (opinionated).
93 | * 2. Remove the margin in Firefox and Safari.
94 | */
95 | button,
96 | input,
97 | optgroup,
98 | select,
99 | textarea {
100 | font-family: sans-serif;
101 | /* 1 */
102 | font-size: 100%;
103 | /* 1 */
104 | line-height: 1.15;
105 | /* 1 */
106 | margin: 0;
107 | /* 2 */
108 | }
109 |
110 | /**
111 | * Show the overflow in IE.
112 | * 1. Show the overflow in Edge.
113 | */
114 | button,
115 | input {
116 | /* 1 */
117 | overflow: visible;
118 | }
119 |
120 | /**
121 | * Remove the inheritance of text transform in Edge, Firefox, and IE.
122 | * 1. Remove the inheritance of text transform in Firefox.
123 | */
124 | button,
125 | select {
126 | /* 1 */
127 | text-transform: none;
128 | }
129 |
130 | /**
131 | * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
132 | * controls in Android 4.
133 | * 2. Correct the inability to style clickable types in iOS and Safari.
134 | */
135 | button,
136 | html [type="button"],
137 | [type="reset"],
138 | [type="submit"] {
139 | -webkit-appearance: button;
140 | /* 2 */
141 | }
142 |
143 | /**
144 | * Remove the inner border and padding in Firefox.
145 | */
146 | button::-moz-focus-inner,
147 | [type="button"]::-moz-focus-inner,
148 | [type="reset"]::-moz-focus-inner,
149 | [type="submit"]::-moz-focus-inner {
150 | border-style: none;
151 | padding: 0;
152 | }
153 |
154 | /**
155 | * Restore the focus styles unset by the previous rule.
156 | */
157 | button:-moz-focusring,
158 | [type="button"]:-moz-focusring,
159 | [type="reset"]:-moz-focusring,
160 | [type="submit"]:-moz-focusring {
161 | outline: 1px dotted ButtonText;
162 | }
163 |
164 | /**
165 | * Correct the padding in Firefox.
166 | */
167 | fieldset {
168 | padding: 0.35em 0.75em 0.625em;
169 | }
170 |
171 | /**
172 | * 1. Correct the text wrapping in Edge and IE.
173 | * 2. Correct the color inheritance from `fieldset` elements in IE.
174 | * 3. Remove the padding so developers are not caught out when they zero out
175 | * `fieldset` elements in all browsers.
176 | */
177 | legend {
178 | box-sizing: border-box;
179 | /* 1 */
180 | color: inherit;
181 | /* 2 */
182 | display: table;
183 | /* 1 */
184 | max-width: 100%;
185 | /* 1 */
186 | padding: 0;
187 | /* 3 */
188 | white-space: normal;
189 | /* 1 */
190 | }
191 |
192 | /**
193 | * 1. Add the correct display in IE 9-.
194 | * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
195 | */
196 | progress {
197 | display: inline-block;
198 | /* 1 */
199 | vertical-align: baseline;
200 | /* 2 */
201 | }
202 |
203 | /**
204 | * Remove the default vertical scrollbar in IE.
205 | */
206 | textarea {
207 | overflow: auto;
208 | }
209 |
210 | /**
211 | * 1. Add the correct box sizing in IE 10-.
212 | * 2. Remove the padding in IE 10-.
213 | */
214 | [type="checkbox"],
215 | [type="radio"] {
216 | box-sizing: border-box;
217 | /* 1 */
218 | padding: 0;
219 | /* 2 */
220 | }
221 |
222 | /**
223 | * Correct the cursor style of increment and decrement buttons in Chrome.
224 | */
225 | [type="number"]::-webkit-inner-spin-button,
226 | [type="number"]::-webkit-outer-spin-button {
227 | height: auto;
228 | }
229 |
230 | /**
231 | * 1. Correct the odd appearance in Chrome and Safari.
232 | * 2. Correct the outline style in Safari.
233 | */
234 | [type="search"] {
235 | -webkit-appearance: textfield;
236 | /* 1 */
237 | outline-offset: -2px;
238 | /* 2 */
239 | }
240 |
241 | /**
242 | * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
243 | */
244 | [type="search"]::-webkit-search-cancel-button,
245 | [type="search"]::-webkit-search-decoration {
246 | -webkit-appearance: none;
247 | }
248 |
249 | /**
250 | * 1. Correct the inability to style clickable types in iOS and Safari.
251 | * 2. Change font properties to `inherit` in Safari.
252 | */
253 | ::-webkit-file-upload-button {
254 | -webkit-appearance: button;
255 | /* 1 */
256 | font: inherit;
257 | /* 2 */
258 | }
259 |
260 | /* Interactive
261 | ========================================================================== */
262 | /*
263 | * Add the correct display in IE 9-.
264 | * 1. Add the correct display in Edge, IE, and Firefox.
265 | */
266 | details,
267 | menu {
268 | display: block;
269 | }
270 |
271 | /*
272 | * Add the correct display in all browsers.
273 | */
274 | summary {
275 | display: list-item;
276 | }
277 |
278 | /* Scripting
279 | ========================================================================== */
280 | /**
281 | * Add the correct display in IE 9-.
282 | */
283 | canvas {
284 | display: inline-block;
285 | }
286 |
287 | /**
288 | * Add the correct display in IE.
289 | */
290 | template {
291 | display: none;
292 | }
293 |
294 | /* Hidden
295 | ========================================================================== */
296 | /**
297 | * Add the correct display in IE 10-.
298 | */
299 | [hidden] {
300 | display: none;
301 | }
302 |
303 | html {
304 | height: 100%;
305 | }
306 |
307 | fieldset {
308 | margin: 0;
309 | padding: 0;
310 | -webkit-margin-start: 0;
311 | -webkit-margin-end: 0;
312 | -webkit-padding-before: 0;
313 | -webkit-padding-start: 0;
314 | -webkit-padding-end: 0;
315 | -webkit-padding-after: 0;
316 | border: 0;
317 | }
318 |
319 | legend {
320 | margin: 0;
321 | padding: 0;
322 | display: block;
323 | -webkit-padding-start: 0;
324 | -webkit-padding-end: 0;
325 | }
326 |
327 | * {
328 | box-sizing: border-box;
329 | }
330 |
331 | .s007 {
332 | min-height: 100vh;
333 | display: -ms-flexbox;
334 | display: flex;
335 | -ms-flex-pack: center;
336 | justify-content: center;
337 | -ms-flex-align: center;
338 | align-items: center;
339 | background: #00b5e9;
340 | padding: 15px;
341 | font-family: 'Roboto', sans-serif;
342 | }
343 |
344 | .s007 form {
345 | width: 100%;
346 | max-width: 790px;
347 | margin: 0;
348 | }
349 |
350 | .s007 form .inner-form {
351 | width: 100%;
352 | }
353 |
354 | .s007 form .inner-form .input-field {
355 | position: relative;
356 | }
357 |
358 | .s007 form .inner-form .input-field input {
359 | height: 100%;
360 | border: 0;
361 | background: #fff;
362 | display: block;
363 | width: 100%;
364 | padding: 10px 32px 10px 70px;
365 | font-size: 18px;
366 | color: #666;
367 | border-radius: 3px;
368 | height: 70px;
369 | color: #555;
370 | }
371 |
372 | .s007 form .inner-form .input-field input.placeholder {
373 | color: #999;
374 | font-size: 18px;
375 | }
376 |
377 | .s007 form .inner-form .input-field input:-moz-placeholder {
378 | color: #999;
379 | font-size: 18px;
380 | }
381 |
382 | .s007 form .inner-form .input-field input::-webkit-input-placeholder {
383 | color: #999;
384 | font-size: 18px;
385 | }
386 |
387 | .s007 form .inner-form .input-field input:hover, .s007 form .inner-form .input-field input:focus {
388 | box-shadow: none;
389 | outline: 0;
390 | }
391 |
392 | .s007 form .inner-form .input-field .btn-search {
393 | min-width: 100px;
394 | height: 40px;
395 | padding: 0 15px;
396 | background: #57b846;
397 | white-space: nowrap;
398 | border-radius: 3px;
399 | font-size: 14px;
400 | color: #fff;
401 | transition: all .2s ease-out, color .2s ease-out;
402 | border: 0;
403 | cursor: pointer;
404 | font-weight: bold;
405 | }
406 |
407 | .s007 form .inner-form .input-field .btn-search:hover {
408 | background: #4ea63f;
409 | }
410 |
411 | .s007 form .inner-form .input-field .btn-delete {
412 | min-width: 100px;
413 | height: 40px;
414 | padding: 0 15px;
415 | background: transparent;
416 | white-space: nowrap;
417 | border-radius: 3px;
418 | font-size: 14px;
419 | color: #555;
420 | transition: all .2s ease-out, color .2s ease-out;
421 | border: 0;
422 | cursor: pointer;
423 | font-weight: bold;
424 | }
425 |
426 | .s007 form .inner-form .input-field .btn-delete:hover {
427 | color: #000;
428 | }
429 |
430 | .s007 form .inner-form .basic-search {
431 | margin-bottom: 5px;
432 | box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
433 | }
434 |
435 | .s007 form .inner-form .basic-search .input-field {
436 | width: 100%;
437 | }
438 |
439 | .s007 form .inner-form .basic-search .input-field input {
440 | padding: 10px 110px 10px 70px;
441 | }
442 |
443 | .s007 form .inner-form .basic-search .input-field .icon-wrap {
444 | position: absolute;
445 | top: 0;
446 | left: 0;
447 | display: -ms-flexbox;
448 | display: flex;
449 | -ms-flex-pack: end;
450 | justify-content: flex-end;
451 | -ms-flex-align: center;
452 | align-items: center;
453 | width: 60px;
454 | height: 100%;
455 | }
456 |
457 | .s007 form .inner-form .basic-search .input-field .icon-wrap svg {
458 | width: 34px;
459 | height: 34px;
460 | fill: #ccc;
461 | }
462 |
463 | .s007 form .inner-form .basic-search .input-field .result-count {
464 | display: -ms-flexbox;
465 | display: flex;
466 | -ms-flex-pack: start;
467 | justify-content: flex-start;
468 | -ms-flex-align: center;
469 | align-items: center;
470 | width: 110px;
471 | top: 0;
472 | right: 0;
473 | position: absolute;
474 | font-weight: bold;
475 | color: #555;
476 | height: 100%;
477 | font-size: 14px;
478 | }
479 |
480 | .s007 form .inner-form .basic-search .input-field .result-count span {
481 | color: #57b846;
482 | padding-right: 5px;
483 | }
484 |
485 | .s007 form .inner-form .advance-search {
486 | background: #fff;
487 | padding: 40px;
488 | border-radius: 3px;
489 | box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
490 | }
491 |
492 | .s007 form .inner-form .advance-search .desc {
493 | font-size: 15px;
494 | color: #999;
495 | display: block;
496 | margin-bottom: 26px;
497 | }
498 |
499 | .s007 form .inner-form .advance-search .row {
500 | display: -ms-flexbox;
501 | display: flex;
502 | -ms-flex-pack: justify;
503 | justify-content: space-between;
504 | -ms-flex-align: center;
505 | align-items: center;
506 | margin-bottom: 20px;
507 | }
508 |
509 | .s007 form .inner-form .advance-search .row.second {
510 | margin-bottom: 46px;
511 | }
512 |
513 | .s007 form .inner-form .advance-search .row.third {
514 | margin-bottom: 0;
515 | }
516 |
517 | .s007 form .inner-form .advance-search .input-field {
518 | width: calc(33.3333% - 30px);
519 | }
520 |
521 | .s007 form .inner-form .advance-search .input-select {
522 | height: 40px;
523 | }
524 |
525 | .s007 form .inner-form .basic-search .input-field input {
526 | padding: 10px 110px 10px 60px;
527 | }
528 | .s007 form .inner-form .basic-search .input-field .icon-wrap {
529 | width: 60px;
530 | -ms-flex-pack: center;
531 | justify-content: center;
532 | }
533 | .s007 form .inner-form .basic-search .input-field .icon-wrap svg {
534 | width: 26px;
535 | height: 26px;
536 | }
537 | .s007 form .inner-form .advance-search .row {
538 | display: block;
539 | }
540 | .s007 form .inner-form .advance-search .input-field {
541 | width: 100%;
542 | margin-bottom: 20px;
543 | }
544 |
545 | #titre{
546 | font-size: 45px;
547 | color: white;
548 | margin-bottom: -12px;
549 | text-shadow: 0 3px 5px rgba(0,0,0,0.45);
550 | margin-left: -3px;
551 | }
552 | #author{
553 | text-shadow: 0 3px 4px rgba(0,0,0,0.45);
554 | position: fixed;
555 | bottom: 7px;
556 | right : 8px;
557 | font-size: 10px;
558 | }
559 | #author img{
560 | box-shadow: 0 3px 4px rgba(0,0,0,0.45);
561 | border-radius:100%;
562 | width: 30%;
563 | }
564 | #author a{
565 | color:black;
566 | text-decoration: none;
567 | }
568 |
569 | a.result{
570 | color:black;
571 | text-decoration: none;
572 | transition: all 0.4s;
573 | }
574 | a.result:hover{
575 | color:#00b5e9;
576 | transition: all 0.4s;
577 | }
578 |
579 | select{
580 | width: 100%;
581 | padding: 10px;
582 | background: white;
583 | border: 1px solid rgba(0,0,0,0.15);
584 | }
585 | span.label{
586 | font-size: 13px;
587 | }
--------------------------------------------------------------------------------
/web/js/main.min.js:
--------------------------------------------------------------------------------
1 | const apiLink="http://127.0.0.1:7777",HOST=["https://jumia.cm","https://jumia.sn","https://www.jumia.com.ng","https://www.jumia.com.eg","https://www.jumia.ma","https://www.jumia.co.ke","https://www.jumia.ci","https://www.jumia.com.tn","https://www.jumia.dz","https://www.jumia.com.gh","https://www.jumia.sn","https://www.jumia.co.tz","https://www.jumia.ug","https://www.jumia.rw","https://www.jumia.com.ng"],CAT=["https://www.jumia.cm/electronique/","https://www.jumia.cm/tvs/","https://www.jumia.cm/smart-tv/","https://www.jumia.cm/tvs-led/","https://www.jumia.cm/ordinateurs-accessoires-informatique/?q=Mini+TV","https://www.jumia.cm/tv-32/","https://www.jumia.cm/son-image-gps/?display_size=40.0--55.0","https://www.jumia.cm/son-image-gps/?display_size=50.0--65.0","https://www.jumia.cm/home-cinema-pour-tv/","https://www.jumia.cm/eclairages-stabilisateurs/","https://www.jumia.cm/electronique-recepteurs-amplificateurs-av/","https://www.jumia.cm/systeme-home-cinema/","https://www.jumia.cm/home-cinema-pour-tv/","https://www.jumia.cm/electronique-haut-parleurs/","https://www.jumia.cm/accessoires-tablette-ecouteurs-casques/","https://www.jumia.cm/lecteur-musique-portable/","https://www.jumia.cm/camera-video/","https://www.jumia.cm/videos/","https://www.jumia.cm/electronique-videosurveillance/","https://www.jumia.cm/photo-accessoires-divers/","https://www.jumia.cm/son-image-gps/","https://www.jumia.cm/tvs/samsung/","https://www.jumia.cm/tvs/lg/","https://www.jumia.cm/tvs/hisense/","https://www.jumia.cm/tvs/star-sat/","https://www.jumia.cm/tvs/kal/","https://www.jumia.cm/tvs/innova/","https://www.jumia.cm/tvs/nasco/","https://www.jumia.cm/frigo-refrigerateurs/fiabtec/","https://www.jumia.cm/telephone-tablette/","https://www.jumia.cm/telephones-smartphones/","https://www.jumia.cm/smartphones/","https://www.jumia.cm/smartphones-android/","https://www.jumia.cm/iphone/","https://www.jumia.cm/telephones-portables/","https://www.jumia.cm/accessoires-telephone/","https://www.jumia.cm/montres-connectees/","https://www.jumia.cm/telephones-tablettes-etuis/","https://www.jumia.cm/telephonie-protecteurs-ecrans/","https://www.jumia.cm/son-image-gps/?q=casque+et+ecouteur&sort=Price%3A+Low+to+High&dir=asc","https://www.jumia.cm/telephones-tablettes-casques-bluetooth/","https://www.jumia.cm/power-banks/","https://www.jumia.cm/catalog/?q=bluetooth","https://www.jumia.cm/telephone-chargeur/","https://www.jumia.cm/samsung-galaxy-s10/","https://www.jumia.cm/huawei-p30/","https://www.jumia.cm/iphone-x/","https://www.jumia.cm/huawei-p20-pro/","https://www.jumia.cm/samsung-a30/","https://www.jumia.cm/tecno-camon-11/","https://www.jumia.cm/samsung-a50/","https://www.jumia.cm/samsung-a70/","https://www.jumia.cm/xiaomi-redmi-6a/","https://www.jumia.cm/tecno-spark-3/","https://www.jumia.cm/xiaomi-redmi-6-pro/","https://www.jumia.cm/samsung-j4-plus/","https://www.jumia.cm/samsung-galaxy-s8/","https://www.jumia.cm/tablettes-tactiles/","https://www.jumia.cm/tablettes-tactiles/huawei/","https://www.jumia.cm/telephones-tablettes-accessoires-tablette/","https://www.jumia.cm/telephone-tablette/","https://www.jumia.cm/telephone-tablette/apple/","https://www.jumia.cm/telephone-tablette/samsung/","https://www.jumia.cm/telephone-tablette/huawei/","https://www.jumia.cm/xiaomi/","https://www.jumia.cm/telephone-tablette/umidigi/","https://www.jumia.cm/telephone-tablette/itel/","https://www.jumia.cm/telephone-tablette/tecno/","https://www.jumia.cm/telephone-tablette/lenovo/","https://www.jumia.cm/maison-cuisine-jardin/","https://www.jumia.cm/maison-bureau-petits-electromenager/","https://www.jumia.cm/maison-cuisine-jardin/?q=micro-onde","https://www.jumia.cm/blenders-chauffants/","https://www.jumia.cm/cuiseurs-a-riz/","https://www.jumia.cm/fers-vapeur/","https://www.jumia.cm/maison-bureau-electromenager/","https://www.jumia.cm/maison-bureau-appareils-cuisson/","https://www.jumia.cm/refrigerateurs-frigo/","https://www.jumia.cm/congelateurs/","https://www.jumia.cm/climatiseur-chauffe-eau/","https://www.jumia.cm/chauffage-refroidissement-qualite-air-climatiseurs-accessoires/","https://www.jumia.cm/outils-de-bricolage/","https://www.jumia.cm/cuisine-cuisson/","https://www.jumia.cm/casseroles-marmites/","https://www.jumia.cm/meubles-a-tiroirs/","https://www.jumia.cm/couteaux-hachoirs/","https://www.jumia.cm/epicerie-nettoyage-domestique/","https://www.jumia.cm/grandes-tailles-bas/","https://www.jumia.cm/cuisine-cuisson/","https://www.jumia.cm/maison-bureau-meubles/","https://www.jumia.cm/linge-de-maison/","https://www.jumia.cm/maison-decoration/","https://www.jumia.cm/maison-bureau-art-mural/","https://www.jumia.cm/maison-bureau-eclairage-ventilateur-plafond/","https://www.jumia.cm/maison-cuisine-jardin/","https://www.jumia.cm/maison-cuisine-jardin/nasco/","https://www.jumia.cm/maison-cuisine-jardin/binatone/","https://www.jumia.cm/maison-cuisine-jardin/a-general/","https://www.jumia.cm/maison-cuisine-jardin/royalty-line/","https://www.jumia.cm/maison-cuisine-jardin/kenwood/","https://www.jumia.cm/maison-cuisine-jardin/scarlett/","https://www.jumia.cm/maison-cuisine-jardin/midea/","https://www.jumia.cm/maison-cuisine-jardin/nova/","https://www.jumia.cm/ordinateurs-accessoires-informatique/","https://www.jumia.cm/ordinateurs-pc/","https://www.jumia.cm/tous-les-ordinateurs-portables/","https://www.jumia.cm/informatique-ordinateurs-fixes/","https://www.jumia.cm/informatique-ordinateurs-fixes/","https://www.jumia.cm/pc-portables/hp/","https://www.jumia.cm/pc-portables/dell/","https://www.jumia.cm/pc-portables/lenovo/","https://www.jumia.cm/pc-portables/asus/","https://www.jumia.cm/imprimantes-pc/","https://www.jumia.cm/imprimantes-pc/","https://www.jumia.cm/scanner/","https://www.jumia.cm/informatique-encre-imprimante-toner/","https://www.jumia.cm/peripheriques-logiciels-accessoires/","https://www.jumia.cm/claviers-et-souris/","https://www.jumia.cm/gaming-graphisme/","https://www.jumia.cm/reseaux-wifi/","https://www.jumia.cm/son-informatique/","https://www.jumia.cm/catalog/?q=sac+ordinateur","https://www.jumia.cm/son-informatique/","https://www.jumia.cm/stockage/","https://www.jumia.cm/cles-usb/","https://www.jumia.cm/cartes-memoires/","https://www.jumia.cm/disques-durs-externes/","https://www.jumia.cm/ordinateurs-accessoires-composants-logiciels/","https://www.jumia.cm/informatique-antivirus-securite/","https://www.jumia.cm/ordinateurs-accessoires-informatique/?q=server","https://www.jumia.cm/ordinateurs-accessoires-informatique/","https://www.jumia.cm/ordinateurs-accessoires-informatique/hp/","https://www.jumia.cm/ordinateurs-accessoires-informatique/lenovo/","https://www.jumia.cm/ordinateurs-accessoires-informatique/asus/","https://www.jumia.cm/ordinateurs-accessoires-informatique/dell/","https://www.jumia.cm/ordinateurs-accessoires-informatique/apple/","https://www.jumia.cm/imprimantes-pc/hp/","https://www.jumia.cm/imprimantes-pc/canon/","https://www.jumia.cm/stockage/seagate/","https://www.jumia.cm/cartes-memoires/sandisk/","https://www.jumia.cm/ordinateurs-accessoires-informatique/tp-link/","https://www.jumia.cm/fashion-mode/","https://www.jumia.cm/fashion-mode-homme/","https://www.jumia.cm/vetements-hommes/","https://www.jumia.cm/chaussures-hommes/","https://www.jumia.cm/accessoires-hommes-mode/","https://www.jumia.cm/vetements-hommes-pantalons/","https://www.jumia.cm/mode-vetements-homme-traditionnels-culturels/","https://www.jumia.cm/bijoux-homme/","https://www.jumia.cm/mode-montres-homme/","https://www.jumia.cm/polos/","https://www.jumia.cm/sous-vetements/","https://www.jumia.cm/mode-mode-enfant/","https://www.jumia.cm/mode-garcons/","https://www.jumia.cm/mode-filles/","https://www.jumia.cm/fashion-mode-femme/","https://www.jumia.cm/robes-femmes-voilees/","https://www.jumia.cm/au-bureau/","https://www.jumia.cm/chaussures-femmes/","https://www.jumia.cm/pantacourts/","https://www.jumia.cm/mode-vetements-traditionnels-culturels/","https://www.jumia.cm/womens-fashion-accessories/","https://www.jumia.cm/mode-montres-femme/","https://www.jumia.cm/lingerie-femme/","https://www.jumia.cm/mode-magasin-sport/","https://www.jumia.cm/mode-magasin-sport/","https://www.jumia.cm/maison-cuisine-jardin/?q=%C3%A0+dos+sac+a","https://www.jumia.cm/mode-accessoires-sport/","https://www.jumia.cm/mode-chaussures-sport/","https://www.jumia.cm/epicerie/","https://www.jumia.cm/epicerie/","https://www.jumia.cm/catalog/?q=riz+parfum%C3%A9","https://www.jumia.cm/catalog/?q=miel","https://www.jumia.cm/epicerie-non-alcoolique/","https://www.jumia.cm/epicerie/?q=jus","https://www.jumia.cm/catalog/?q=caf%C3%A9+th%C3%A9","https://www.jumia.cm/divers/?q=lait","https://www.jumia.cm/epicerie-biere-vin-spiritueux/","https://www.jumia.cm/epicerie-du-vin/","https://www.jumia.cm/epicerie-champagne-vin-mousseux/","https://www.jumia.cm/epicerie-spiritueux-liqueurs/","https://www.jumia.cm/soin-cheveux/","https://www.jumia.cm/anti-age/","https://www.jumia.cm/beaute-hygiene-sante/?q=savon","https://www.jumia.cm/catalog/?q=deodorant","https://www.jumia.cm/epicerie-nettoyage-domestique/","https://www.jumia.cm/accessoires-de-nettoyage/","https://www.jumia.cm/desodorisants-parfums-d-ambiance/","https://www.jumia.cm/beaute-hygiene-sante/","https://www.jumia.cm/parfums/","https://www.jumia.cm/parfums-homme/","https://www.jumia.cm/parfums-femme/","https://www.jumia.cm/maquillage/","https://www.jumia.cm/produits-maquillage-visage/","https://www.jumia.cm/produits-maquillage-yeux/","https://www.jumia.cm/maquillage-levres/","https://www.jumia.cm/maquillage-ongles/","https://www.jumia.cm/ensembles-rasage-toilettage/","https://www.jumia.cm/sante-beaute-beaute-soins-personnels/","https://www.jumia.cm/soin-hydratant-reparateur/","https://www.jumia.cm/rasage-epilation/","https://www.jumia.cm/soin-et-beaute/?q=foot+care","https://www.jumia.cm/hygiene-feminine/","https://www.jumia.cm/sante-beaute-soins-bucco-dentaires/","https://www.jumia.cm/sante-beaute-beaute-soins-personnels/?q=men+beauty","https://www.jumia.cm/razors-blades/","https://www.jumia.cm/sante-beaute-bien-etre-relaxation/","https://www.jumia.cm/beaute-hygiene-sante/nivea/","https://www.jumia.cm/beaute-hygiene-sante/yves-rocher/","https://www.jumia.cm/beaute-hygiene-sante/longrich/","https://www.jumia.cm/beaute-hygiene-sante/neutrogena/","https://www.jumia.cm/beaute-hygiene-sante/kylie/","https://www.jumia.cm/beaute-hygiene-sante/f-fashion/","https://www.jumia.cm/beaute-hygiene-sante/bio-oil/","https://www.jumia.cm/beaute-hygiene-sante/smart-collection/","https://www.jumia.cm/beaute-hygiene-sante/balea/","https://www.jumia.cm/beaute-hygiene-sante/maybelline/","https://www.jumia.cm/bebe-puericulture/","https://www.jumia.cm/produits-bebes-soin-peau/","https://www.jumia.cm/produits-bebes-savons-nettoyants/","https://www.jumia.cm/produits-bebes-vetements-accessoires/","https://www.jumia.cm/mode-bebe-garcon/","https://www.jumia.cm/mode-filles-chaussures-bebes/","https://www.jumia.cm/couches-toilettes-bebe/","https://www.jumia.cm/lingettes-bebe/","https://www.jumia.cm/repas-de-bebe/","https://www.jumia.cm/produits-bebes-nourriture-bebes/","https://www.jumia.cm/produits-bebes-biberon/","https://www.jumia.cm/produits-bebes-bain-soin-peau/","https://www.jumia.cm/chicco/","https://www.jumia.cm/matelas-de-jeux-pour-bebe/legrand/","https://www.jumia.cm/jeux-videos-consoles/","https://www.jumia.cm/jeux-videos-consoles/playstation/","https://www.jumia.cm/sports-loisirs/","https://www.jumia.cm/sport-fitness-musculation/","https://www.jumia.cm/automobile-outils/","https://www.jumia.cm/livres-papeterie/","https://www.jumia.cm/terrasse-jardin-exterieur/","https://www.jumia.cm/industriel-scientifique/","https://www.jumia.cm/instruments-musique/","https://www.jumia.cm/animalerie/","https://www.jumia.cm/deals-billetterie/","https://www.jumia.cm/jeux-et-jouets/"];for(var hostBox=document.getElementById("host"),i=0,l=HOST.length;i "+parseInt(i+100),option.value="0-"+(i+100),priceBox.options.add(option)}let xhr=new XMLHttpRequest;var resultBox=document.getElementById("results");document.getElementById("price").onchange=function(t){document.getElementById("percent").value="0"},document.getElementById("percent").onchange=function(t){document.getElementById("price").value="0"},document.getElementById("gogo").onclick=function(t){t.preventDefault(),document.getElementsByTagName("html")[0].style.overflow="auto",document.getElementById("estimated").innerHTML="Loading, please wait few seconds...",document.getElementById("results").innerHTML=" ",document.getElementById("code").innerHTML="",xhr.open("GET",apiLink+"/flash?host="+document.getElementById("host").value+"&percent="+document.getElementById("percent").value+"&find="+document.getElementById("search").value+"&level="+document.getElementById("level").value+"&price="+document.getElementById("price").value+"&category="+document.getElementById("category").value),xhr.responseType="json",xhr.send(),xhr.onload=function(){if(200!=xhr.status)alert(`Error ${xhr.status}: ${xhr.statusText}`);else{document.getElementById("results").innerHTML="",document.getElementById("code").innerHTML=xhr.response.code,document.getElementById("estimated").innerHTML=xhr.response.fetched+" and "+xhr.response.filtered;for(var t=0,e=xhr.response.results.length;t"+xhr.response.results[t].title+" ";resultBox.innerHTML+=s}}},xhr.onerror=function(){alert("Request failed"),document.getElementById("results").innerHTML=""}};
--------------------------------------------------------------------------------
/web/js/main.js:
--------------------------------------------------------------------------------
1 | const apiLink = "http://127.0.0.1:7777";
2 | const HOST = [
3 | "https://jumia.cm",
4 | "https://jumia.sn",
5 | "https://www.jumia.com.ng",
6 | "https://www.jumia.com.eg",
7 | "https://www.jumia.ma",
8 | "https://www.jumia.co.ke",
9 | "https://www.jumia.ci",
10 | "https://www.jumia.com.tn",
11 | "https://www.jumia.dz",
12 | "https://www.jumia.com.gh",
13 | "https://www.jumia.sn",
14 | "https://www.jumia.co.tz",
15 | "https://www.jumia.ug",
16 | "https://www.jumia.rw",
17 | "https://www.jumia.com.ng"
18 | ]
19 |
20 | const CAT = ['https://www.jumia.cm/electronique/',
21 | 'https://www.jumia.cm/tvs/',
22 | 'https://www.jumia.cm/smart-tv/',
23 | 'https://www.jumia.cm/tvs-led/',
24 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/?q=Mini+TV',
25 | 'https://www.jumia.cm/tv-32/',
26 | 'https://www.jumia.cm/son-image-gps/?display_size=40.0--55.0',
27 | 'https://www.jumia.cm/son-image-gps/?display_size=50.0--65.0',
28 | 'https://www.jumia.cm/home-cinema-pour-tv/',
29 | 'https://www.jumia.cm/eclairages-stabilisateurs/',
30 | 'https://www.jumia.cm/electronique-recepteurs-amplificateurs-av/',
31 | 'https://www.jumia.cm/systeme-home-cinema/',
32 | 'https://www.jumia.cm/home-cinema-pour-tv/',
33 | 'https://www.jumia.cm/electronique-haut-parleurs/',
34 | 'https://www.jumia.cm/accessoires-tablette-ecouteurs-casques/',
35 | 'https://www.jumia.cm/lecteur-musique-portable/',
36 | 'https://www.jumia.cm/camera-video/',
37 | 'https://www.jumia.cm/videos/',
38 | 'https://www.jumia.cm/electronique-videosurveillance/',
39 | 'https://www.jumia.cm/photo-accessoires-divers/',
40 | 'https://www.jumia.cm/son-image-gps/',
41 | 'https://www.jumia.cm/tvs/samsung/',
42 | 'https://www.jumia.cm/tvs/lg/',
43 | 'https://www.jumia.cm/tvs/hisense/',
44 | 'https://www.jumia.cm/tvs/star-sat/',
45 | 'https://www.jumia.cm/tvs/kal/',
46 | 'https://www.jumia.cm/tvs/innova/',
47 | 'https://www.jumia.cm/tvs/nasco/',
48 | 'https://www.jumia.cm/frigo-refrigerateurs/fiabtec/',
49 | 'https://www.jumia.cm/telephone-tablette/',
50 | 'https://www.jumia.cm/telephones-smartphones/',
51 | 'https://www.jumia.cm/smartphones/',
52 | 'https://www.jumia.cm/smartphones-android/',
53 | 'https://www.jumia.cm/iphone/',
54 | 'https://www.jumia.cm/telephones-portables/',
55 | 'https://www.jumia.cm/accessoires-telephone/',
56 | 'https://www.jumia.cm/montres-connectees/',
57 | 'https://www.jumia.cm/telephones-tablettes-etuis/',
58 | 'https://www.jumia.cm/telephonie-protecteurs-ecrans/',
59 | 'https://www.jumia.cm/son-image-gps/?q=casque+et+ecouteur&sort=Price%3A+Low+to+High&dir=asc',
60 | 'https://www.jumia.cm/telephones-tablettes-casques-bluetooth/',
61 | 'https://www.jumia.cm/power-banks/',
62 | 'https://www.jumia.cm/catalog/?q=bluetooth',
63 | 'https://www.jumia.cm/telephone-chargeur/',
64 | 'https://www.jumia.cm/samsung-galaxy-s10/',
65 | 'https://www.jumia.cm/huawei-p30/',
66 | 'https://www.jumia.cm/iphone-x/',
67 | 'https://www.jumia.cm/huawei-p20-pro/',
68 | 'https://www.jumia.cm/samsung-a30/',
69 | 'https://www.jumia.cm/tecno-camon-11/',
70 | 'https://www.jumia.cm/samsung-a50/',
71 | 'https://www.jumia.cm/samsung-a70/',
72 | 'https://www.jumia.cm/xiaomi-redmi-6a/',
73 | 'https://www.jumia.cm/tecno-spark-3/',
74 | 'https://www.jumia.cm/xiaomi-redmi-6-pro/',
75 | 'https://www.jumia.cm/samsung-j4-plus/',
76 | 'https://www.jumia.cm/samsung-galaxy-s8/',
77 | 'https://www.jumia.cm/tablettes-tactiles/',
78 | 'https://www.jumia.cm/tablettes-tactiles/huawei/',
79 | 'https://www.jumia.cm/telephones-tablettes-accessoires-tablette/',
80 | 'https://www.jumia.cm/telephone-tablette/',
81 | 'https://www.jumia.cm/telephone-tablette/apple/',
82 | 'https://www.jumia.cm/telephone-tablette/samsung/',
83 | 'https://www.jumia.cm/telephone-tablette/huawei/',
84 | 'https://www.jumia.cm/xiaomi/',
85 | 'https://www.jumia.cm/telephone-tablette/umidigi/',
86 | 'https://www.jumia.cm/telephone-tablette/itel/',
87 | 'https://www.jumia.cm/telephone-tablette/tecno/',
88 | 'https://www.jumia.cm/telephone-tablette/lenovo/',
89 | 'https://www.jumia.cm/maison-cuisine-jardin/',
90 | 'https://www.jumia.cm/maison-bureau-petits-electromenager/',
91 | 'https://www.jumia.cm/maison-cuisine-jardin/?q=micro-onde',
92 | 'https://www.jumia.cm/blenders-chauffants/',
93 | 'https://www.jumia.cm/cuiseurs-a-riz/',
94 | 'https://www.jumia.cm/fers-vapeur/',
95 | 'https://www.jumia.cm/maison-bureau-electromenager/',
96 | 'https://www.jumia.cm/maison-bureau-appareils-cuisson/',
97 | 'https://www.jumia.cm/refrigerateurs-frigo/',
98 | 'https://www.jumia.cm/congelateurs/',
99 | 'https://www.jumia.cm/climatiseur-chauffe-eau/',
100 | 'https://www.jumia.cm/chauffage-refroidissement-qualite-air-climatiseurs-accessoires/',
101 | 'https://www.jumia.cm/outils-de-bricolage/',
102 | 'https://www.jumia.cm/cuisine-cuisson/',
103 | 'https://www.jumia.cm/casseroles-marmites/',
104 | 'https://www.jumia.cm/meubles-a-tiroirs/',
105 | 'https://www.jumia.cm/couteaux-hachoirs/',
106 | 'https://www.jumia.cm/epicerie-nettoyage-domestique/',
107 | 'https://www.jumia.cm/grandes-tailles-bas/',
108 | 'https://www.jumia.cm/cuisine-cuisson/',
109 | 'https://www.jumia.cm/maison-bureau-meubles/',
110 | 'https://www.jumia.cm/linge-de-maison/',
111 | 'https://www.jumia.cm/maison-decoration/',
112 | 'https://www.jumia.cm/maison-bureau-art-mural/',
113 | 'https://www.jumia.cm/maison-bureau-eclairage-ventilateur-plafond/',
114 | 'https://www.jumia.cm/maison-cuisine-jardin/',
115 | 'https://www.jumia.cm/maison-cuisine-jardin/nasco/',
116 | 'https://www.jumia.cm/maison-cuisine-jardin/binatone/',
117 | 'https://www.jumia.cm/maison-cuisine-jardin/a-general/',
118 | 'https://www.jumia.cm/maison-cuisine-jardin/royalty-line/',
119 | 'https://www.jumia.cm/maison-cuisine-jardin/kenwood/',
120 | 'https://www.jumia.cm/maison-cuisine-jardin/scarlett/',
121 | 'https://www.jumia.cm/maison-cuisine-jardin/midea/',
122 | 'https://www.jumia.cm/maison-cuisine-jardin/nova/',
123 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/',
124 | 'https://www.jumia.cm/ordinateurs-pc/',
125 | 'https://www.jumia.cm/tous-les-ordinateurs-portables/',
126 | 'https://www.jumia.cm/informatique-ordinateurs-fixes/',
127 | 'https://www.jumia.cm/informatique-ordinateurs-fixes/',
128 | 'https://www.jumia.cm/pc-portables/hp/',
129 | 'https://www.jumia.cm/pc-portables/dell/',
130 | 'https://www.jumia.cm/pc-portables/lenovo/',
131 | 'https://www.jumia.cm/pc-portables/asus/',
132 | 'https://www.jumia.cm/imprimantes-pc/',
133 | 'https://www.jumia.cm/imprimantes-pc/',
134 | 'https://www.jumia.cm/scanner/',
135 | 'https://www.jumia.cm/informatique-encre-imprimante-toner/',
136 | 'https://www.jumia.cm/peripheriques-logiciels-accessoires/',
137 | 'https://www.jumia.cm/claviers-et-souris/',
138 | 'https://www.jumia.cm/gaming-graphisme/',
139 | 'https://www.jumia.cm/reseaux-wifi/',
140 | 'https://www.jumia.cm/son-informatique/',
141 | 'https://www.jumia.cm/catalog/?q=sac+ordinateur',
142 | 'https://www.jumia.cm/son-informatique/',
143 | 'https://www.jumia.cm/stockage/',
144 | 'https://www.jumia.cm/cles-usb/',
145 | 'https://www.jumia.cm/cartes-memoires/',
146 | 'https://www.jumia.cm/disques-durs-externes/',
147 | 'https://www.jumia.cm/ordinateurs-accessoires-composants-logiciels/',
148 | 'https://www.jumia.cm/informatique-antivirus-securite/',
149 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/?q=server',
150 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/',
151 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/hp/',
152 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/lenovo/',
153 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/asus/',
154 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/dell/',
155 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/apple/',
156 | 'https://www.jumia.cm/imprimantes-pc/hp/',
157 | 'https://www.jumia.cm/imprimantes-pc/canon/',
158 | 'https://www.jumia.cm/stockage/seagate/',
159 | 'https://www.jumia.cm/cartes-memoires/sandisk/',
160 | 'https://www.jumia.cm/ordinateurs-accessoires-informatique/tp-link/',
161 | 'https://www.jumia.cm/fashion-mode/',
162 | 'https://www.jumia.cm/fashion-mode-homme/',
163 | 'https://www.jumia.cm/vetements-hommes/',
164 | 'https://www.jumia.cm/chaussures-hommes/',
165 | 'https://www.jumia.cm/accessoires-hommes-mode/',
166 | 'https://www.jumia.cm/vetements-hommes-pantalons/',
167 | 'https://www.jumia.cm/mode-vetements-homme-traditionnels-culturels/',
168 | 'https://www.jumia.cm/bijoux-homme/',
169 | 'https://www.jumia.cm/mode-montres-homme/',
170 | 'https://www.jumia.cm/polos/',
171 | 'https://www.jumia.cm/sous-vetements/',
172 | 'https://www.jumia.cm/mode-mode-enfant/',
173 | 'https://www.jumia.cm/mode-garcons/',
174 | 'https://www.jumia.cm/mode-filles/',
175 | 'https://www.jumia.cm/fashion-mode-femme/',
176 | 'https://www.jumia.cm/robes-femmes-voilees/',
177 | 'https://www.jumia.cm/au-bureau/',
178 | 'https://www.jumia.cm/chaussures-femmes/',
179 | 'https://www.jumia.cm/pantacourts/',
180 | 'https://www.jumia.cm/mode-vetements-traditionnels-culturels/',
181 | 'https://www.jumia.cm/womens-fashion-accessories/',
182 | 'https://www.jumia.cm/mode-montres-femme/',
183 | 'https://www.jumia.cm/lingerie-femme/',
184 | 'https://www.jumia.cm/mode-magasin-sport/',
185 | 'https://www.jumia.cm/mode-magasin-sport/',
186 | 'https://www.jumia.cm/maison-cuisine-jardin/?q=%C3%A0+dos+sac+a',
187 | 'https://www.jumia.cm/mode-accessoires-sport/',
188 | 'https://www.jumia.cm/mode-chaussures-sport/',
189 | 'https://www.jumia.cm/epicerie/',
190 | 'https://www.jumia.cm/epicerie/',
191 | 'https://www.jumia.cm/catalog/?q=riz+parfum%C3%A9',
192 | 'https://www.jumia.cm/catalog/?q=miel',
193 | 'https://www.jumia.cm/epicerie-non-alcoolique/',
194 | 'https://www.jumia.cm/epicerie/?q=jus',
195 | 'https://www.jumia.cm/catalog/?q=caf%C3%A9+th%C3%A9',
196 | 'https://www.jumia.cm/divers/?q=lait',
197 | 'https://www.jumia.cm/epicerie-biere-vin-spiritueux/',
198 | 'https://www.jumia.cm/epicerie-du-vin/',
199 | 'https://www.jumia.cm/epicerie-champagne-vin-mousseux/',
200 | 'https://www.jumia.cm/epicerie-spiritueux-liqueurs/',
201 | 'https://www.jumia.cm/soin-cheveux/',
202 | 'https://www.jumia.cm/anti-age/',
203 | 'https://www.jumia.cm/beaute-hygiene-sante/?q=savon',
204 | 'https://www.jumia.cm/catalog/?q=deodorant',
205 | 'https://www.jumia.cm/epicerie-nettoyage-domestique/',
206 | 'https://www.jumia.cm/accessoires-de-nettoyage/',
207 | 'https://www.jumia.cm/desodorisants-parfums-d-ambiance/',
208 | 'https://www.jumia.cm/beaute-hygiene-sante/',
209 | 'https://www.jumia.cm/parfums/',
210 | 'https://www.jumia.cm/parfums-homme/',
211 | 'https://www.jumia.cm/parfums-femme/',
212 | 'https://www.jumia.cm/maquillage/',
213 | 'https://www.jumia.cm/produits-maquillage-visage/',
214 | 'https://www.jumia.cm/produits-maquillage-yeux/',
215 | 'https://www.jumia.cm/maquillage-levres/',
216 | 'https://www.jumia.cm/maquillage-ongles/',
217 | 'https://www.jumia.cm/ensembles-rasage-toilettage/',
218 | 'https://www.jumia.cm/sante-beaute-beaute-soins-personnels/',
219 | 'https://www.jumia.cm/soin-hydratant-reparateur/',
220 | 'https://www.jumia.cm/rasage-epilation/',
221 | 'https://www.jumia.cm/soin-et-beaute/?q=foot+care',
222 | 'https://www.jumia.cm/hygiene-feminine/',
223 | 'https://www.jumia.cm/sante-beaute-soins-bucco-dentaires/',
224 | 'https://www.jumia.cm/sante-beaute-beaute-soins-personnels/?q=men+beauty',
225 | 'https://www.jumia.cm/razors-blades/',
226 | 'https://www.jumia.cm/sante-beaute-bien-etre-relaxation/',
227 | 'https://www.jumia.cm/beaute-hygiene-sante/nivea/',
228 | 'https://www.jumia.cm/beaute-hygiene-sante/yves-rocher/',
229 | 'https://www.jumia.cm/beaute-hygiene-sante/longrich/',
230 | 'https://www.jumia.cm/beaute-hygiene-sante/neutrogena/',
231 | 'https://www.jumia.cm/beaute-hygiene-sante/kylie/',
232 | 'https://www.jumia.cm/beaute-hygiene-sante/f-fashion/',
233 | 'https://www.jumia.cm/beaute-hygiene-sante/bio-oil/',
234 | 'https://www.jumia.cm/beaute-hygiene-sante/smart-collection/',
235 | 'https://www.jumia.cm/beaute-hygiene-sante/balea/',
236 | 'https://www.jumia.cm/beaute-hygiene-sante/maybelline/',
237 | 'https://www.jumia.cm/bebe-puericulture/',
238 | 'https://www.jumia.cm/produits-bebes-soin-peau/',
239 | 'https://www.jumia.cm/produits-bebes-savons-nettoyants/',
240 | 'https://www.jumia.cm/produits-bebes-vetements-accessoires/',
241 | 'https://www.jumia.cm/mode-bebe-garcon/',
242 | 'https://www.jumia.cm/mode-filles-chaussures-bebes/',
243 | 'https://www.jumia.cm/couches-toilettes-bebe/',
244 | 'https://www.jumia.cm/lingettes-bebe/',
245 | 'https://www.jumia.cm/repas-de-bebe/',
246 | 'https://www.jumia.cm/produits-bebes-nourriture-bebes/',
247 | 'https://www.jumia.cm/produits-bebes-biberon/',
248 | 'https://www.jumia.cm/produits-bebes-bain-soin-peau/',
249 | 'https://www.jumia.cm/chicco/',
250 | 'https://www.jumia.cm/matelas-de-jeux-pour-bebe/legrand/',
251 | 'https://www.jumia.cm/jeux-videos-consoles/',
252 | 'https://www.jumia.cm/jeux-videos-consoles/playstation/',
253 | 'https://www.jumia.cm/sports-loisirs/',
254 | 'https://www.jumia.cm/sport-fitness-musculation/',
255 | 'https://www.jumia.cm/automobile-outils/',
256 | 'https://www.jumia.cm/livres-papeterie/',
257 | 'https://www.jumia.cm/terrasse-jardin-exterieur/',
258 | 'https://www.jumia.cm/industriel-scientifique/',
259 | 'https://www.jumia.cm/instruments-musique/',
260 | 'https://www.jumia.cm/animalerie/',
261 | 'https://www.jumia.cm/deals-billetterie/',
262 | 'https://www.jumia.cm/jeux-et-jouets/'
263 | ]
264 |
265 | // Host box
266 | var hostBox = document.getElementById('host');
267 | for(var i = 0, l = HOST.length; i < l; i++){
268 | var option = document.createElement("option");
269 | option.text = HOST[i];
270 | hostBox.options.add( option );
271 | }
272 |
273 | // Categorie box
274 | var catBox = document.getElementById('category');
275 | var option = document.createElement("option");
276 | option.text = "Any";
277 | option.value = 0;
278 | catBox.options.add( option );
279 | for(var i = 0, l = CAT.length; i < l; i++){
280 | var option = document.createElement("option");
281 | option.value = CAT[i];
282 | option.text = CAT[i].replace("https://www.jumia.cm/", "").replace("/", "");
283 | catBox.options.add( option );
284 | }
285 |
286 | // Percent Host
287 | var percentBox = document.getElementById('percent');
288 | var option = document.createElement("option");
289 | option.text = "Any";
290 | option.value = 0;
291 | percentBox.options.add( option );
292 | for(var i = 5, l = 100; i < l; i++){
293 | var option = document.createElement("option");
294 | option.text = "-"+i+"%";
295 | option.value = i;
296 | percentBox.options.add( option );
297 | }
298 |
299 | var priceBox = document.getElementById('price');
300 | var option = document.createElement("option");
301 | option.text = "Any";
302 | option.value = 0;
303 | priceBox.options.add( option );
304 | for(var i = 100, l = 999999; i < l; i+=100){
305 | var option = document.createElement("option");
306 | option.text = 0+" -> "+parseInt(i+100);
307 | option.value = (0+"-"+(i+100));
308 | priceBox.options.add( option );
309 | }
310 |
311 | // 1. Create a new XMLHttpRequest object
312 | let xhr = new XMLHttpRequest();
313 | var resultBox = document.getElementById('results');
314 |
315 |
316 | document.getElementById("price").onchange = function(e){
317 | document.getElementById("percent").value = "0";
318 |
319 | }
320 | document.getElementById("percent").onchange = function(e){
321 | document.getElementById("price").value = "0";
322 | }
323 |
324 | document.getElementById("gogo").onclick = function(e){
325 | e.preventDefault();
326 |
327 | // if(document.getElementById("search").value.length <= 1){
328 | // alert("Provide something to search!")
329 | // return false;
330 | // }
331 | document.getElementsByTagName("html")[0].style.overflow = "auto"
332 | document.getElementById("estimated").innerHTML = "Loading, please wait few seconds...";
333 | document.getElementById('results').innerHTML = " ";
334 | document.getElementById('code').innerHTML = "";
335 | // 2. Configure it: GET-request for the URL /article/.../load
336 | xhr.open('GET', apiLink+'/flash?host='+document.getElementById("host").value+
337 | "&percent="+document.getElementById("percent").value+
338 | "&find="+document.getElementById("search").value+
339 | "&level="+document.getElementById("level").value+
340 | "&price="+document.getElementById("price").value+
341 | "&category="+document.getElementById("category").value+
342 | "¬_contain="+(document.getElementById("not_contain").value.length === 0 ? "qscred243":document.getElementById("not_contain").value)+
343 | "&must_contain="+document.getElementById("must_contain").value);
344 |
345 | xhr.responseType = 'json';
346 |
347 | // 3. Send the request over the network
348 | xhr.send();
349 |
350 | // 4. This will be called after the response is received
351 | xhr.onload = function() {
352 | if (xhr.status != 200) { // analyze HTTP status of the response
353 | alert(`Error ${xhr.status}: ${xhr.statusText}`); // e.g. 404: Not Found
354 | } else {
355 | document.getElementById('results').innerHTML = "";
356 | // show the result
357 | // alert(`Done, got ${xhr.response.length} bytes`); // responseText is the server
358 | //console.log(xhr.response);
359 | document.getElementById("code").innerHTML = (xhr.response !== null ? xhr.response.code: "------");
360 | document.getElementById("estimated").innerHTML = xhr.response.fetched + " and " + xhr.response.filtered;
361 | var valuee = ""
362 | for(var i = 0, l = xhr.response.results.length; i < l; i++){
363 | if(xhr.response.results[i]["percent"] == 0){
364 | valuee = xhr.response.results[i]["price"];
365 | }else{
366 | valuee = "-"+xhr.response.results[i]["percent"]+"%";
367 | }
368 | var format = " "
369 | resultBox.innerHTML += format;
370 | }
371 |
372 | }
373 | };
374 |
375 | xhr.onerror = function() {
376 | alert("Request failed");
377 | document.getElementById('results').innerHTML = "";
378 | };
379 | };
--------------------------------------------------------------------------------