From 412c061450d1fac96261091f31006559ca678280 Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 29 Mar 2022 18:19:28 +0530 Subject: [PATCH] RSS Feed, fixed date sort --- _config.yml | 2 +- _includes/head.html | 8 ++++++++ _includes/location.html | 16 ++++++++++++++++ _layouts/home.html | 25 ++++++------------------- feed.xml | 35 +++++++++++++++++++++++++++++++++++ index.md | 4 +++- 6 files changed, 69 insertions(+), 21 deletions(-) create mode 100644 _includes/head.html create mode 100644 _includes/location.html create mode 100644 feed.xml diff --git a/_config.yml b/_config.yml index aae5b78..1152e55 100644 --- a/_config.yml +++ b/_config.yml @@ -1,4 +1,4 @@ -title: Plugo.io Data +title: Plugo.io Powerbanks List of locations email: plugo@captnemo.in description: > Easily accessible website detailing where all plugo powerbanks are available. diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 0000000..9965661 --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,8 @@ + + + + + + + {%- seo -%} + \ No newline at end of file diff --git a/_includes/location.html b/_includes/location.html new file mode 100644 index 0000000..1b9ff5e --- /dev/null +++ b/_includes/location.html @@ -0,0 +1,16 @@ +{% assign city_lower_case = include.data.city|downcase %} + {{include.data.name}}
+ {% if include.data.floor!="NA"%}{{include.data.floor}}, {%endif %} +{% assign address = include.data.address %} +{% for mapping in site.include.data.city %} +{% assign old=mapping[0] %} +{% assign new=mapping[1] %} +{% assign address = address|replace:old,new %} +{% endfor %} + {{address}} +
+ {% assign w=include.data.website|strip %} + {% if w!="" %}
🔗{%endif%} + 🗺 +{%comment%}8047112182 is Plugo's office number{%endcomment%} +{% if include.data.mobile %}{%unless include.data.mobile contains '8047112182' %} 📞{%endunless%}{%endif%} \ No newline at end of file diff --git a/_layouts/home.html b/_layouts/home.html index c7b5c18..e7bbbcd 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -18,33 +18,20 @@ layout: default {% assign locations = site.data.plugo|sort:'state' %} {% assign total = 0 %} {% for row in locations %} - + + + {%comment%} {% assign state_lower_case = row.state|downcase %} - {% assign city_lower_case = row.city|downcase %} - - {{row.name}}
- {% if row.floor!="NA"%}{{row.floor}}, {%endif %} - {% assign address = row.address %} - {% for mapping in site.data.city %} - {% assign old=mapping[0] %} - {% assign new=mapping[1] %} - {% assign address = address|replace:old,new %} - {% endfor %} - {{address}} -
- {% assign w=row.website|strip %} - {% if w!="" %}
🔗{%endif%} - 🗺 - {%comment%}8047112182 is Plugo's office number{%endcomment%} - {% if row.mobile %}{%unless row.mobile contains '8047112182' %} 📞{%endunless%}{%endif%} + {%endcomment%} + {% include location.html data=row %} {{row.business}} {{row.totalAvailablePowerbanks}} {% if row.totalAvailablePowerbanks == 0 %} {% assign zeroPowerBankLocations = zeroPowerBankLocations | plus:1 %} {% endif %} - {{row.createdAt | date_to_string}} + {{row.createdAt | date_to_string}} {% assign total = total|plus:row.totalAvailablePowerbanks %} diff --git a/feed.xml b/feed.xml new file mode 100644 index 0000000..e2bd809 --- /dev/null +++ b/feed.xml @@ -0,0 +1,35 @@ +--- +--- + + + + Plugo Powerbanks Location Availability + RSS Feed of Plugo.io locations. New locations will automatically send you a notification. + daily + 1 + {{ site.url }}{{site.baseurl}} + + {{ site.time | date_to_rfc822 }} + {% assign locations = site.data.plugo | sort:'createdAt' | reverse %} + {% for row in locations limit:10 %} + + {{ row.name | xml_escape }} + {%capture description%} + + {% include location.html data=row %} +
+ Location Type: {{row.business}} + {%endcapture%} + + {{ description | xml_escape }}
+ {{ row.createdAt | date_to_rfc822 }} + {{ site.url }}{{site.baseurl}}#{{row.id}} + {{row.id}} +
+ {% endfor %} +
+
\ No newline at end of file diff --git a/index.md b/index.md index 95fbd2e..c75c7a1 100644 --- a/index.md +++ b/index.md @@ -2,4 +2,6 @@ layout: home --- -[Plugo](https://plugo.io/) is "India's first smart & fully automated power bank rental service". They have a mobile app [[iOS](https://apps.apple.com/in/app/plugo/id1469215249), [Android](https://play.google.com/store/apps/details?id=com.plugo)] that provides information about where you can find their powerbanks, but the same is not accessible on the web. This page hosts republished (and slightly cleaned up) data from the Plugo app, updated on a regular schedule in an easily accessible and searchable format. \ No newline at end of file +[Plugo](https://plugo.io/) is "India's first smart & fully automated power bank rental service". They have a mobile app [[iOS](https://apps.apple.com/in/app/plugo/id1469215249), [Android](https://play.google.com/store/apps/details?id=com.plugo)] that provides information about where you can find their powerbanks, but the same is not accessible on the web. This page hosts republished (and slightly cleaned up) data from the Plugo app, updated on a regular schedule in an easily accessible and searchable format. + +A RSS feed is also available to get notified of new locations at [/feed.xml](/feed.xml). \ No newline at end of file