-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #500 from dwyl/contact-form-spam-#487
Resolve Contact form `SPAM` #487
- Loading branch information
Showing
18 changed files
with
160 additions
and
3,715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "07:00" | ||
timezone: Europe/London |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x, 16.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
# - run: npm run build --if-present | ||
- run: npm test | ||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
'use strict'; | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var http_request = require('./http_request'); | ||
var cheerio = require('cheerio'); // Server-side JQuery. v. useful for scraping! | ||
|
||
// Adding Colors to Terminal *Without* a Library/Module | ||
var bgRedBlack = '\x1b[41m\x1b[30m'; | ||
var bgGreenBlack = '\x1b[42m\x1b[30m'; | ||
var RESET = '\x1b[0m'; // see: https://stackoverflow.com/a/41407246/1148249 | ||
// var bgRedBlack = '\x1b[41m\x1b[30m'; | ||
// var bgGreenBlack = '\x1b[42m\x1b[30m'; | ||
// var RESET = '\x1b[0m'; // see: https://stackoverflow.com/a/41407246/1148249 | ||
|
||
var URL = 'https://github.com/dwyl/home/blob/master/README.md'; | ||
|
||
http_request(URL, function (status, html) { | ||
// eslint forces us to have all vars declared before logic ... | ||
var $ = cheerio.load(html); // load the HTML of the rendered markdown "page" | ||
var body = $('#readme').html(); // parse the contents of #readme (article) | ||
var css = fs.readFileSync(path.resolve(__dirname, './style.css'), 'utf8'); | ||
var template = fs.readFileSync(path.resolve(__dirname, './template.html'), | ||
'utf8'); // rudimentary "template" with string subtitution. | ||
var out = template.replace('{css}', css).replace('{content}', body); | ||
|
||
if (status !== 200 || !html) { | ||
console.log(bgRedBlack, | ||
" - - - GitHub Scraper FAIL >> " + URL + " - - - ", RESET); | ||
process.exit(); | ||
} | ||
else { | ||
var $ = cheerio.load(html); // load the HTML of the rendered markdown "page" | ||
var body = $('#readme').html() // parse the contents of #readme (article) | ||
var css = fs.readFileSync(path.resolve(__dirname, './style.css'), 'utf8'); | ||
var template = fs.readFileSync(path.resolve(__dirname, './template.html'), | ||
'utf8'); // rudimentary "template" with string subtitution. | ||
var out = template.replace('{css}', css).replace('{content}', body); | ||
// console.log(bgRedBlack, | ||
// " - - - GitHub Scraper FAIL >> " + URL + " - - - ", RESET); | ||
// process.exit(); | ||
} else { | ||
fs.writeFileSync('./home.html', out, 'utf8'); // save the file | ||
console.log(bgGreenBlack, 'done.', RESET); | ||
// console.log(bgGreenBlack, 'done.', RESET); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,59 +128,10 @@ <h3 class="dwyl-yellow">Job Opportunities</h3> | |
</section> | ||
</section> | ||
|
||
<section class="dwyl-bg-mint center pv5-ns pb5-ns relative z-0"> | ||
<a id="contact" class="h2 dib h0-l di-l absolute top--2"></a> | ||
<div class="mw8 center"> | ||
<div class="dib-ns w-50-ns dtc v-top"> | ||
<div class="w-80 w-60-ns white center tr"> | ||
<h2 class="mt0-ns mb3 pl4-ns f-xl fw9">Let's</h2> | ||
<h2 class="pl4-ns mt3 f-xl fw9">Talk</h2> | ||
</div> | ||
<div class="w-80-ns w-90 ml3"> | ||
<a href="tel:+447708796446" class="link"><h2 class="tr white"><span class="dwyl-dark-gray fw9">Tel: </span>+44 (0) 7708 796446</h2></a> | ||
<a href="mailto:[email protected]" class="link"><h2 class="tr white"><span class="dwyl-dark-gray fw9">Email:</span> [email protected]</h2></a> | ||
<h2 class="tr white"><span class="dwyl-dark-gray lh-copy fw9">Address:</span> dwyl, First Floor, <br>149 Fonthill Rd,<br> London, N4 3HF, UK</h2> | ||
<p class="tr dwyl-dark-gray">(We'll get back to you within 24 hours)</p> | ||
</div> | ||
</div> | ||
|
||
<div class="dib-ns bg-white pt4 pa2 shadow-4 ml3-ns ml3-m ml4-l w-40-ns"> | ||
|
||
<form id="gform" method="POST" class="tc tl-ns" action="https://script.google.com/a/dwyl.com/macros/s/AKfycbzWvg1lK6-FddTv8gQxiUW76FCtC_-pD05rZpuurI4_5sST3eI/exec"> | ||
<!-- change the form action to your script url --> | ||
<div class="mt2 ml3"> | ||
<label for="name" class="db mb2 tl pl3 pl0-ns">Your Name</label> | ||
<input id="name" name="name" class="br2 ba dwyl-b--dark-gray pa2 w-90 border-box" placeholder="Tim Berners-Lee" /> | ||
</div> | ||
<div class="mt3 ml3"> | ||
<label for="email" class="db mb2 tl pl3 pl0-ns">Email Address</label> | ||
<input id="email" name="email" class="br2 ba dwyl-b--dark-gray pa2 w-90 border-box" type="email" value="" required placeholder="[email protected]" /> | ||
</div> | ||
<div class="mt3 ml3"> | ||
<label for="message" class="db mb2 tl pl3 pl0-ns">Message</label> | ||
<textarea id="message" name="message" class="br2 ba w-90 dwyl-b--dark-gray pa2" rows="10" placeholder="What problem can we solve for you?"></textarea> | ||
</div> | ||
<button class="bn dib link mt3 mb3 ph3 pv2 dwyl-bg-orange white br2 f5 ml3 shadow-4 pointer montserrat"> | ||
<i class="fa fa-paper-plane"></i> Say Hello | ||
</button> | ||
</form> | ||
|
||
<div style="display:none;" class="tc pb4 dwyl-dark-gray" id="thankyou_message"> | ||
<h2>Thanks for contacting us!</h2> | ||
<h2>We will get back to you soon!</h2> | ||
</div> | ||
|
||
<!-- Submit the Form to Google Using "AJAX" --> | ||
<script data-cfasync="false" type="text/javascript" src="/js/app_contact_form_handler.js"></script> | ||
<!-- END --> | ||
</div> | ||
</div> | ||
</section> | ||
<footer class="dwyl-bg-dark-gray white pt1 pt3-ns pb4 tc center"> | ||
<div class="bb b--white w-90-ns w-80 center"> | ||
<ul class="list tc pl0 pt3 pb3-ns mv0 f3 f5-ns "> | ||
<li class="ph4 fw3 f6 dib-ns pv2"><a href="/" class="white link">Home</a></li> | ||
<li class="ph4 fw3 f6 dib-ns pv2"><a href="/portfolio" class="white link">Portfolio</a></li> | ||
<li class="ph4 fw3 f6 dib-ns pv2"><a href="/careers" class="white link">Careers</a></li> | ||
<div class="dib"> | ||
<li class="ph4 fw3 f6 dib-ns pv2"><a href="/community" class="white link">Community</a></li> | ||
|
@@ -197,9 +148,11 @@ <h2>We will get back to you soon!</h2> | |
</a> | ||
</div> | ||
<p class="w-80 w-90-ns center f7 pt2-ns"> | ||
Copyright 2019 © DWYL LTD, company number 09525434 registered in England & Wales at First Floor, 149 Fonthill Rd, London N4 3HF. All rights reserved. | ||
Copyright 2023 © DWYL LTD, | ||
company number 09525434 registered | ||
in England & Wales at First Floor, | ||
149 Fonthill Rd, London N4 3HF. | ||
</p> | ||
<img src="/img/common/dwyl-grey-heart.png" alt="dwyl heart logo" class="pv4"> | ||
</footer> | ||
|
||
<section id="cookie-notification" class="w-100 dwyl-bg-dark-gray bottom-0 fixed h-auto tc-ns tl ph4-ns pt3-ns pb2-ns pt3 ph3 "> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,13 +57,12 @@ | |
</a> | ||
</li> | ||
<li class="ph4 pt5 pb2 tl dn-l"><a href="/" class="dwyl-dark-gray link">Home</a></li> | ||
<li class="ph4 di-l pv2 tl pv0-l"><a href="/portfolio" class="dwyl-dark-gray link">Portfolio</a></li> | ||
<li class="ph4 di-l pv2 tl pv0-l"><a href="/values" class="dwyl-dark-gray link">Values</a></li> | ||
<li class="ph4 di-l pv2 tl pv0-l"><a href="/team" class="dwyl-dark-gray link">Team</a></li> | ||
<li class="ph4 dib-l pv2 tl pv0-l"><a href="/time-app" class="dwyl-dark-gray link">App | ||
<span class="dwyl-bg-yellow fw3 pa1 br2 f7 shadow-6">BETA</span></a></li> | ||
<!-- <li class="ph4 di-l pv2 tl pv0-l"><a href="/blog" class="dwyl-dark-gray link">Blog</a></li> --> | ||
<li class="ph4 di-l pt2 pb3 tl pv0-l"><a href="#contact" id="contact-link" class="dwyl-dark-gray link">Contact</a></li> | ||
<!-- <li class="ph4 di-l pt2 pb3 tl pv0-l"><a href="#contact" id="contact-link" class="dwyl-dark-gray link">Contact</a></li> --> | ||
</ul> | ||
</nav> | ||
|
||
|
@@ -93,59 +92,11 @@ <h2 class="dwyl-light-gray w-90 w-50-ns center lh-copy mt4 mt2-ns f4">dwyl is a | |
</p> | ||
</section> | ||
|
||
<section class="dwyl-bg-mint center pv5-ns pb5-ns relative z-0"> | ||
<a id="contact" class="h2 dib h0-l di-l absolute top--2"></a> | ||
<div class="mw8 center"> | ||
<div class="dib-ns w-50-ns dtc v-top"> | ||
<div class="w-80 w-60-ns white center tr"> | ||
<h2 class="mt0-ns mb3 pl4-ns f-xl fw9">Let's</h2> | ||
<h2 class="pl4-ns mt3 f-xl fw9">Talk</h2> | ||
</div> | ||
<div class="w-80-ns w-90 ml3"> | ||
<a href="tel:+447708796446" class="link"><h2 class="tr white"><span class="dwyl-dark-gray fw9">Tel: </span>+44 (0) 7708 796446</h2></a> | ||
<a href="mailto:[email protected]" class="link"><h2 class="tr white"><span class="dwyl-dark-gray fw9">Email:</span> [email protected]</h2></a> | ||
<h2 class="tr white"><span class="dwyl-dark-gray lh-copy fw9">Address:</span> dwyl, First Floor, <br>149 Fonthill Rd,<br> London, N4 3HF, UK</h2> | ||
<p class="tr dwyl-dark-gray">(We'll get back to you within 24 hours)</p> | ||
</div> | ||
</div> | ||
|
||
<div class="dib-ns bg-white pt4 pa2 shadow-4 ml3-ns ml3-m ml4-l w-40-ns"> | ||
|
||
<form id="gform" method="POST" class="tc tl-ns" action="https://script.google.com/a/dwyl.com/macros/s/AKfycbzWvg1lK6-FddTv8gQxiUW76FCtC_-pD05rZpuurI4_5sST3eI/exec"> | ||
<!-- change the form action to your script url --> | ||
<div class="mt2 ml3"> | ||
<label for="name" class="db mb2 tl pl3 pl0-ns">Your Name</label> | ||
<input id="name" name="name" class="br2 ba dwyl-b--dark-gray pa2 w-90 border-box" placeholder="Tim Berners-Lee" /> | ||
</div> | ||
<div class="mt3 ml3"> | ||
<label for="email" class="db mb2 tl pl3 pl0-ns">Email Address</label> | ||
<input id="email" name="email" class="br2 ba dwyl-b--dark-gray pa2 w-90 border-box" type="email" value="" required placeholder="[email protected]" /> | ||
</div> | ||
<div class="mt3 ml3"> | ||
<label for="message" class="db mb2 tl pl3 pl0-ns">Message</label> | ||
<textarea id="message" name="message" class="br2 ba w-90 dwyl-b--dark-gray pa2" rows="10" placeholder="What problem can we solve for you?"></textarea> | ||
</div> | ||
<button class="bn dib link mt3 mb3 ph3 pv2 dwyl-bg-orange white br2 f5 ml3 shadow-4 pointer montserrat"> | ||
<i class="fa fa-paper-plane"></i> Say Hello | ||
</button> | ||
</form> | ||
|
||
<div style="display:none;" class="tc pb4 dwyl-dark-gray" id="thankyou_message"> | ||
<h2>Thanks for contacting us!</h2> | ||
<h2>We will get back to you soon!</h2> | ||
</div> | ||
|
||
<!-- Submit the Form to Google Using "AJAX" --> | ||
<script data-cfasync="false" type="text/javascript" src="/js/app_contact_form_handler.js"></script> | ||
<!-- END --> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<footer class="dwyl-bg-dark-gray white pt1 pt3-ns pb4 tc center"> | ||
<div class="bb b--white w-90-ns w-80 center"> | ||
<ul class="list tc pl0 pt3 pb3-ns mv0 f3 f5-ns "> | ||
<li class="ph4 fw3 f6 dib-ns pv2"><a href="/" class="white link">Home</a></li> | ||
<li class="ph4 fw3 f6 dib-ns pv2"><a href="/portfolio" class="white link">Portfolio</a></li> | ||
<li class="ph4 fw3 f6 dib-ns pv2"><a href="/careers" class="white link">Careers</a></li> | ||
<div class="dib"> | ||
<li class="ph4 fw3 f6 dib-ns pv2"><a href="/community" class="white link">Community</a></li> | ||
|
@@ -162,9 +113,11 @@ <h2>We will get back to you soon!</h2> | |
</a> | ||
</div> | ||
<p class="w-80 w-90-ns center f7 pt2-ns"> | ||
Copyright 2019 © DWYL LTD, company number 09525434 registered in England & Wales at First Floor, 149 Fonthill Rd, London N4 3HF. All rights reserved. | ||
Copyright 2023 © DWYL LTD, | ||
company number 09525434 registered | ||
in England & Wales at First Floor, | ||
149 Fonthill Rd, London N4 3HF. | ||
</p> | ||
<img src="/img/common/dwyl-grey-heart.png" alt="dwyl heart logo" class="pv4"> | ||
</footer> | ||
|
||
<section id="cookie-notification" class="w-100 dwyl-bg-dark-gray bottom-0 fixed h-auto tc-ns tl ph4-ns pt3-ns pb2-ns pt3 ph3 "> | ||
|
Oops, something went wrong.