Skip to content

Commit

Permalink
Merge pull request #2321 from liberapay/obsolete-elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco authored Mar 4, 2024
2 parents 1d7d3f7 + 8c96e80 commit 8788fd9
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 165 deletions.
5 changes: 0 additions & 5 deletions js/10-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ Liberapay.init = function() {

Liberapay.forms.jsSubmit();

// http://stackoverflow.com/questions/7131909/facebook-callback-appends-to-return-url
if (window.location.hash == '#_=_') {
window.location.hash = ''; // leaves a # behind
}

var success_re = /([?&])success=[^&]*/;
if (success_re.test(location.search)) {
history.replaceState(null, null,
Expand Down
2 changes: 0 additions & 2 deletions liberapay/elsewhere/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

def _import():
from .bitbucket import Bitbucket # noqa
from .facebook import Facebook # noqa
from .github import GitHub # noqa
from .gitlab import GitLab # noqa
from .google import Google # noqa
from .linuxfr import LinuxFr # noqa
from .mastodon import Mastodon # noqa
from .openstreetmap import OpenStreetMap # noqa
Expand Down
1 change: 0 additions & 1 deletion liberapay/elsewhere/_paginators.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def f(self, response, parsed):

def keys_paginator(page_key, **kw):
# https://confluence.atlassian.com/display/BITBUCKET/Version+2#Version2-Pagingthroughobjectcollections
# https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging
paging_key = kw.get('paging')
total_key = kw.get('total')
links_keys_map = tuple((k, kw.get(k, k)) for k in links_keys)
Expand Down
35 changes: 0 additions & 35 deletions liberapay/elsewhere/facebook.py

This file was deleted.

57 changes: 0 additions & 57 deletions liberapay/elsewhere/google.py

This file was deleted.

2 changes: 1 addition & 1 deletion liberapay/models/account_elsewhere.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def refetch_elsewhere_data():
AND (e.missing_since IS NULL OR e.missing_since > (current_timestamp - interval '30 days'))
AND (e.last_fetch_attempt IS NULL OR e.last_fetch_attempt < (current_timestamp - interval '3 days'))
AND (p.status = 'active' OR p.receiving > 0)
AND e.platform NOT IN ('facebook', 'google', 'youtube')
AND e.platform <> 'youtube'
ORDER BY e.info_fetched_at ASC
LIMIT 1
)
Expand Down
55 changes: 0 additions & 55 deletions liberapay/testing/elsewhere.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,61 +218,6 @@
"listed_count": 7
}

facebook = lambda: {
"id": "187701977",
"first_name": "Chad",
"gender": "male",
"last_name": "Whitacre",
"link": "https://www.facebook.com/whit537",
"locale": "en_US",
"name": "Chad Whitacre",
"username": "whit537"
}

google = lambda: {
"resourceName": "people/110791859286178226496",
"etag": "%EgkBAj0DBgo1Ny4aDAECAwQFBgcICQoLDCIMVXJJdG5BdEg2eXc9",
"names": [
{
"metadata": {
"primary": True,
"source": {
"type": "PROFILE",
"id": "110791859286178226496"
}
},
"displayName": "Arthur Panda",
"familyName": "Panda",
"givenName": "Arthur",
"displayNameLastFirst": "Panda, Arthur"
}
],
"nicknames": [
{
"metadata": {
"primary": True,
"source": {
"type": "PROFILE",
"id": "110791859286178226496"
}
},
"value": "Changaco"
}
],
"photos": [
{
"metadata": {
"primary": True,
"source": {
"type": "PROFILE",
"id": "110791859286178226496"
}
},
"url": "https://lh6.googleusercontent.com/-JMfIhnfsuPw/AAAAAAAAAAI/AAAAAAAAABY/M5ldFOyJAPs/s100/photo.jpg"
}
]
}

twitch = lambda: {
"data": [{
"id": "44322889",
Expand Down
3 changes: 0 additions & 3 deletions liberapay/wireup.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ class AppConf:
check_email_domains=bool,
check_email_servers=bool,
cron_intervals=dict,
facebook_callback=str,
facebook_id=str,
facebook_secret=str,
github_callback=str,
github_id=str,
github_secret=str,
Expand Down
3 changes: 0 additions & 3 deletions sql/app-conf-defaults.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ INSERT INTO app_conf (key, value) VALUES
('check_email_domains', 'true'::jsonb),
('check_email_servers', 'true'::jsonb),
('cron_intervals', jsonb_build_object()),
('facebook_callback', '"http://localhost:8339/on/facebook/associate"'::jsonb),
('facebook_id', '"1418954898427187"'::jsonb),
('facebook_secret', '"3bcb5dc6ce821e5202870c1e6ef5bbc4"'::jsonb),
('github_callback', '"http://127.0.0.1:8339/on/github/associate"'::jsonb),
('github_id', '"18891d01e40e5aef93b8"'::jsonb),
('github_secret', '"46f75669895e96029d57b64832d6f2c8e6291a0e"'::jsonb),
Expand Down
2 changes: 2 additions & 0 deletions sql/branch.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DELETE FROM elsewhere WHERE platform in ('facebook', 'google');
DELETE FROM app_conf WHERE key LIKE 'facebook_%';
1 change: 0 additions & 1 deletion style/base/icons.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.fa-brand-color {
// https://logo-colors.com/
&.fa-bitbucket { color: #0052cc; }
&.fa-facebook-square { color: #3c5598; }
&.fa-github { color: #24292e; }
&.fa-gitlab { color: #fca326; }
&.fa-mastodon { color: #6364ff; }
Expand Down
4 changes: 2 additions & 2 deletions tests/py/test_elsewhere.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ def test_connect_might_need_confirmation(self, gui, gusi, ft):
def test_connect_failure(self):
alice = self.make_participant('alice')
error = 'User canceled the Dialog flow'
url = '/on/facebook/associate?error_message=%s&state=deadbeef' % error
url = '/on/github/associate?error_message=%s&state=deadbeef' % error
cookie = b64encode_s(json.dumps(['query_data', 'connect', '', '2']))
response = self.client.GxT(url, auth_as=alice,
cookies={'facebook_deadbeef': cookie})
cookies={'github_deadbeef': cookie})
assert response.code == 502, response.text
assert error in response.text

Expand Down

0 comments on commit 8788fd9

Please sign in to comment.