Skip to content

Commit 999fea7

Browse files
committed
Adding Flask + Saving mails n data/suscribers.ptm + Adding automates files for Windows and linux user + adding the form on index.html to complete the saving process + Adding a local LAUNCH server [HTTP-SERVER]
1 parent bc369bc commit 999fea7

File tree

384 files changed

+35966
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+35966
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ PyToMe have a list of website where it wil fetch data(jobs/projects) and will no
3232
- [ In progress... ] The Python Job (Collecting/Fetching jobs all over website with frequency.)
3333
- [ - ] The Mailing system to notify all developpers subscribed on this app.
3434
- [OK] The Web page where to suscribe to PyToMe.
35+
- [OK] Saving Mails.
3536
- [ - ] The Python Config (For personnalize notifications)
3637
- [ - ] The Type (Remote Jobs, full time, etc...).
3738
- [ - ] The country / city.
@@ -45,7 +46,7 @@ PyToMe have a list of website where it wil fetch data(jobs/projects) and will no
4546
[Sanix-darker](https://github.com/sanix-darker)
4647

4748
## Contributors
48-
...
49+
[Adonis Simo](https://github.com/simo97)
4950

5051
## Organization
5152
[Python Cameroon](https://github.com/python-cameroun)

api/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
WEBSITE_DATABASE = "./data/website.ptm"
6464

6565
def Presentation():
66+
print "====PYTHON CAMEROUN===================================="
6667
print "-------------------------------------------------------"
6768
print "--------------------- PYTHOME v0.1 --------------------"
6869
print "-------------------------------------------------------"

api/data/suscribers.ptm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

api/launch_Linux_user.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export FLASK_APP=suscribe.py
2+
flask run

api/launch_windows_user.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set FLASK_APP=suscribe.py
2+
python -m flask run

api/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
flask
12
requests
23
BeautifulSoup4
34
schedule

api/suscribe.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# i create this file because i wanted to separate the
2+
# main workflow of the application and his differents modules
3+
from flask import Flask, request
4+
app = Flask(__name__)
5+
6+
@app.route('/')
7+
def start():
8+
if request.args.get("email") != "None":
9+
f=open("data/suscribers.ptm", "a+")
10+
if f.mode == 'a+':
11+
f.write(request.args.get("email") + "\n")
12+
f.close()
13+
return '{message: "Email saved successfully!"}'
14+
else:
15+
return '{message: "Something went wrong with the file!"}'
16+
else:
17+
return '{message: "Error, Email not found!"}'

index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ <h1>PytoMe</h1>
2323
<p>Sign up to be notify on all python jobs around the world.<br>
2424
(For remote job or full time one)!</p>
2525
<div class="InputAddOn">
26-
<input type="email" placeholder="Enter your Email"/>
27-
<button class="InputAddOn-item"><img src="assets/img/paper-plane.png"/></button>
26+
<form action="http://127.0.0.1:5000/" method="get">
27+
<input type="email" name="email" placeholder="Enter your Email"/>
28+
<button class="InputAddOn-item" type="submit"><img src="assets/img/paper-plane.png"/></button>
29+
</form>
2830
</div>
2931
</div>
3032
</div>

node_modules/.bin/ecstatic

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/ecstatic.cmd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)