Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Add Disqus #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ resetdb: ## Reset the dev database
dumpgeo: ## Dump building geo data
$(MANAGE) dumpgeo > data/geocoding.csv

loadgeo: ## Load saved geo data
$(MANAGE) loadgeo data/geocoding.csv

scrape: ## Scrape new data
cd data && $(MAKE) $(MFLAGS) clean elevator_data_file.csv
python tx_elevators/scripts/scrape.py data/elevator_data_file.csv
@echo "should geocode the top 1000 too: $(MANAGE) geocode"


# timing for trivial import real 1m51.994s
# timing for a fresh import real 4m15.279s
import:
Expand Down Expand Up @@ -55,15 +57,16 @@ web/stop: web.pid
# FINISHED --2016-04-01 04:48:54--
# Total wall clock time: 4m 59s
# Downloaded: 26757 files, 126M in 0.1s (971 MB/s)
site: ## Scrape the site
site: web/start
mkdir -p ._site
cd ._site && wget -r localhost:$(PORT) --force-html -e robots=off -nH -nv --max-redirect 0 || true
@$(MAKE) web/stop

serve:
serve: ## Serve from the scraped site on port 8088
cd ._site && python -m SimpleHTTPServer 8088

upload:
upload: ## Upload the scraped site to s3
aws s3 sync ._site s3://$(AWS_BUCKET_NAME)/ \
--cache-control "max-age=2592000" \
--acl "public-read"
6 changes: 3 additions & 3 deletions tx_elevators/static/tx_elevators/js/tx_elevators.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@
centerLatLng.longitude);
var pinColor = "FFFF00";
var pinImage = new google.maps.MarkerImage(
"http://chart.apis.google.com/chart?chst=d_map_pin_icon&chld=home|" + pinColor,
"https://chart.apis.google.com/chart?chst=d_map_pin_icon&chld=home|" + pinColor,
new google.maps.Size(21, 34),
new google.maps.Point(0,0),
new google.maps.Point(10, 34));
var pinShadow = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",
var pinShadow = new google.maps.MarkerImage("https://chart.apis.google.com/chart?chst=d_map_pin_shadow",
new google.maps.Size(40, 37),
new google.maps.Point(0, 0),
new google.maps.Point(12, 35));
Expand Down Expand Up @@ -139,7 +139,7 @@
position = new google.maps.LatLng(building.latitude, building.longitude);

pinImage = new google.maps.MarkerImage(
"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=" +
"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=" +
String.fromCharCode(65 + i) + "|" + pinColor,
new google.maps.Size(21, 34),
new google.maps.Point(0,0),
Expand Down
6 changes: 3 additions & 3 deletions tx_elevators/templates/tx_elevators/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ <h3>Code</h3>
<p>

The code for this site is available under an open source license at
<a href="https://github.com/texastribune/tx_elevators" target="_blank">GitHub</a>.
<a href="https://github.com/texas/tx_elevators" target="_blank">GitHub</a>.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have: render the README.md to HTML in the build process!

It was coded over a few nights and most of a
<a href="https://github.com/texastribune/tx_elevators/graphs/punch-card" target="_blank">weekend</a>
<a href="https://github.com/texas/tx_elevators/graphs/punch-card" target="_blank">weekend</a>
by a programmer from
<a href="http://www.texastribune.org/about/staff/" target="_blank">The Texas Tribune</a>.
<a href="https://www.texastribune.org/about/staff/" target="_blank">The Texas Tribune</a>.

</p>
</section>
Expand Down
17 changes: 17 additions & 0 deletions tx_elevators/templates/tx_elevators/building_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,21 @@ <h2>Elevators</h2>
</tbody>
</table>
<a class="prefetch-hint" href="{% url 'tx_elevators:chart:search' %}" rel="nofollow" style="display: none;"></a>

<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
var disqus_config = function () {
this.page.identifier = '{{ object.elbi }}';
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//tx-elevators.disqus.com/embed.js';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't verify since I'm not an admin, but syntactically 👍

s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>

{% endblock %}