From 5b31f55b18178736d30af7b1844c22ebea901674 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 3 Aug 2015 10:17:23 -0500 Subject: [PATCH] Add questionablequesting.com as another base_xenforoforum adapter. --- fanficfare/adapters/__init__.py | 1 + .../adapters/adapter_forumsspacebattlescom.py | 13 ------- .../adapter_forumssufficientvelocitycom.py | 4 --- .../adapter_questionablequestingcom.py | 35 +++++++++++++++++++ 4 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 fanficfare/adapters/adapter_questionablequestingcom.py diff --git a/fanficfare/adapters/__init__.py b/fanficfare/adapters/__init__.py index 6c4e1c88..43505b79 100644 --- a/fanficfare/adapters/__init__.py +++ b/fanficfare/adapters/__init__.py @@ -137,6 +137,7 @@ import adapter_tgstorytimecom import adapter_itcouldhappennet import adapter_forumsspacebattlescom import adapter_forumssufficientvelocitycom +import adapter_questionablequestingcom import adapter_ninelivesdarksolaceorg import adapter_masseffect2in diff --git a/fanficfare/adapters/adapter_forumsspacebattlescom.py b/fanficfare/adapters/adapter_forumsspacebattlescom.py index 0a58c65d..0bf0d654 100644 --- a/fanficfare/adapters/adapter_forumsspacebattlescom.py +++ b/fanficfare/adapters/adapter_forumsspacebattlescom.py @@ -15,15 +15,6 @@ # limitations under the License. # -import time -import logging -logger = logging.getLogger(__name__) -import re -import urllib2 - -from ..htmlcleanup import stripHTML -from .. import exceptions as exceptions - from base_xenforoforum_adapter import BaseXenForoForumAdapter def getClass(): @@ -42,7 +33,3 @@ class ForumsSpacebattlesComAdapter(BaseXenForoForumAdapter): # The site domain. Does have www here, if it uses it. return 'forums.spacebattles.com' - @classmethod - def getURLPrefix(cls): - return 'https://' + cls.getSiteDomain() - diff --git a/fanficfare/adapters/adapter_forumssufficientvelocitycom.py b/fanficfare/adapters/adapter_forumssufficientvelocitycom.py index 883dc749..baa2540c 100644 --- a/fanficfare/adapters/adapter_forumssufficientvelocitycom.py +++ b/fanficfare/adapters/adapter_forumssufficientvelocitycom.py @@ -32,7 +32,3 @@ class ForumsSufficientVelocityComAdapter(BaseXenForoForumAdapter): def getSiteDomain(): # The site domain. Does have www here, if it uses it. return 'forums.sufficientvelocity.com' - - @classmethod - def getURLPrefix(cls): - return 'http://' + cls.getSiteDomain() diff --git a/fanficfare/adapters/adapter_questionablequestingcom.py b/fanficfare/adapters/adapter_questionablequestingcom.py new file mode 100644 index 00000000..0709dd46 --- /dev/null +++ b/fanficfare/adapters/adapter_questionablequestingcom.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +# Copyright 2015 FanFicFare team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from base_xenforoforum_adapter import BaseXenForoForumAdapter + +def getClass(): + return QuestionablequestingComAdapter + +class QuestionablequestingComAdapter(BaseXenForoForumAdapter): + + def __init__(self, config, url): + BaseXenForoForumAdapter.__init__(self, config, url) + + # Each adapter needs to have a unique site abbreviation. + self.story.setMetadata('siteabbrev','qq') + + @staticmethod # must be @staticmethod, don't remove it. + def getSiteDomain(): + # The site domain. Does have www here, if it uses it. + return 'questionablequesting.com' +