Skip to content

Commit

Permalink
turn off facebook publish signup for new users
Browse files Browse the repository at this point in the history
for #817
  • Loading branch information
snarfed committed Apr 27, 2018
1 parent 93596ce commit 4e8c17d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app.py
Expand Up @@ -244,6 +244,11 @@ def template_vars(self):
else self.source.domain_urls[0] if self.source.domain_urls
else None)

kind = self.source.key.kind()
vars['publish_signup_ok'] = (self.source.created < facebook.PUBLISH_SIGNUP_CUTOFF
if kind == 'FacebookPage'
else kind not in ('Instagram', 'GooglePlus'))

# Blog webmention promos
if 'webmention' not in self.source.features:
if self.source.SHORT_NAME in ('blogger', 'medium', 'tumblr', 'wordpress'):
Expand Down
4 changes: 4 additions & 0 deletions facebook.py
Expand Up @@ -21,6 +21,7 @@
"""
from __future__ import unicode_literals

import datetime
import heapq
import itertools
import json
Expand All @@ -40,6 +41,9 @@
import models
import util

# don't let people turn on publish if they signed up after this date.
# https://github.com/snarfed/bridgy/issues/817
PUBLISH_SIGNUP_CUTOFF = datetime.datetime(2018, 4, 27)

# https://developers.facebook.com/docs/reference/login/
LISTEN_SCOPES = [
Expand Down
2 changes: 2 additions & 0 deletions templates/facebook_user.html
Expand Up @@ -14,11 +14,13 @@
{% endblock %}

{% block publish_signup %}
{% if publish_signup_ok %}
<span class="big">Click to enable <a href="/about#publish">publishing</a>:</span>
<form method="post" name="publish-facebook-start" action="/facebook/start" class="signup">
<input type="image" alt="Sign in with Facebook"
src="/oauth_dropins/static/facebook.png" />
<input name="feature" type="hidden" value="publish" />
<input name="id" type="hidden" value="{{ source.key.id() }}" />
</form>
{% endif %}
{% endblock %}
2 changes: 1 addition & 1 deletion templates/index.html
Expand Up @@ -28,7 +28,7 @@
{{ publishes }} posts published,
{{ blogposts }} blog posts processed,
<!-- {{ webmentions_received }} blog webmentions received -->
<a href="https://snarfed.org/2016-06-06_bridgy-stats-update-2">and counting...</a>
<a href="https://snarfed.org/2018-01-02_bridgy-stats-update-3">and counting...</a>
</p>

{% endblock %}
2 changes: 1 addition & 1 deletion templates/social_user.html
Expand Up @@ -65,7 +65,7 @@
<div class="row">

<!-- Listen UI -->
<div id="listen-ui" class="{% if source.SHORT_NAME not in ('instagram', 'googleplus') %}col-sm-6{% endif %}">
<div id="listen-ui" class="{% if publish_signup_ok %}col-sm-6{% endif %}">

{% if "listen" in source.features and source.status != "disabled" %}
<data class="p-bridgy-listen-status" value="enabled">
Expand Down

0 comments on commit 4e8c17d

Please sign in to comment.