Skip to content

Instantly share code, notes, and snippets.

View arthur-abogadil's full-sized avatar

Arthur Abogadil arthur-abogadil

View GitHub Profile
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<div class="center page_1">
<form class="center siteschecker-form" id="siteschecker-form">
<div class="form-field">
<label for="businessname">Business Name: </label> <br />
<input class="inputset" type="text" name="business-name" id="business-name" placeholder="SitesNStores">
</div>
{
"captchaResult": "CAPTCHA_NOT_NEEDED",
"kind": "pagespeedonline#result",
"id": "https://developers.google.com/",
"loadingExperience": {
"id": "https://developers.google.com/",
"metrics": {
"FIRST_CONTENTFUL_PAINT_MS": {
"percentile": 3482,
"distributions": [
pages:[
{src:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/optimized/1.jpg", thumb:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/thumbs/Thumb-1.jpg", title:"1.jpg"},
{src:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/optimized/2.jpg", thumb:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/thumbs/Thumb-2.jpg", title:"2.jpg"},
{src:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/optimized/3.jpg", thumb:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/thumbs/Thumb-3.jpg", title:"3.jpg"},
{src:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/optimized/4.jpg", thumb:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/thumbs/Thumb-4.jpg", title:"4.jpg"},
{src:"
def score
pass = 0
pass_or_fail = 0
results.each do |result|
if result.status == "1" || result.status == "0"
pass_or_fail += 1
pass += 1 if result.status == "1"
end
end
score = ((pass.to_f * 5) / pass_or_fail.to_f).to_f
def result_description(key_name)
descriptions = {
:report_google_adwords_campaign => "We checked to see if you have any Google Adwords campaigns
running and if you would benefit from running a campaign.
AdWords campaigns are an effective way to reach customers
when they're looking for your products or services.",
:report_google_organic_campaign => "We crawled your site to test for best practice on-page
optimisation factors required to help it rank better. It's
important to have your on-page optimisation in order to help
def explanation_score(score)
if score <= 2
"We have a bad and a good news. The bad news is that your website is not doing things properly in terms of marketing at all, you lack many improvements. The good news is that we can help you to fix that. It's actually that simple, just click the green button and you will find it out."
elsif score <= 4
"Excellent! So you know something about web marketing after all, you are doing many stuff the right way, however you can do it better than that! Just give us the chance to lend you a hand and improve your score together. Click the green button to start enhancing your website."
else
"Your website is pretty good in terms of marketing, you have implemented most of the tools that bring visitors to your page. However, no one is perfect and we can always learn new things and get more visitors. Believe us, we are very good on what we do. Contact us and we will prove it to you!"
end
end
# This is a blank test case that should fail everything
<!-- Facebook -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
@arthur-abogadil
arthur-abogadil / result messages
Created February 17, 2021 06:33
result messages
def result_description(key_name)
descriptions = {
:report_google_adwords_campaign => "We checked to see if you have any Google Adwords campaigns
running and if you would benefit from running a campaign.
AdWords campaigns are an effective way to reach customers
when they're looking for your products or services.",
:report_google_organic_campaign => "We crawled your site to test for best practice on-page
optimisation factors required to help it rank better. It's
important to have your on-page optimisation in order to help
@arthur-abogadil
arthur-abogadil / forCC.
Last active July 6, 2020 07:33
for cc.
// Im not able to show some of the most important things ive written for my last customizer project
// as im bound by an NDA, but here i can present some simple things in the utilities libraries
// that ive devised and used that helped
// the architecture of the projects ive created much cleaner
// This is a very simple js idiom i developed early in the development
// of the customizer, it basically just uses the jquery rest call function
ub.loader = function (url, object_name, cb) {