v/pol
1
0
mirror of https://github.com/taroved/pol synced 2025-05-28 03:50:08 -07:00
This commit is contained in:
Alexandr Nesterenko 2017-06-26 13:58:59 -07:00
parent 5a15140682
commit ea8164ff2c
8 changed files with 47 additions and 36 deletions

25
feed.py
View File

@ -1,15 +1,3 @@
from twisted.web import server, resource
from twisted.internet import reactor, endpoints
from twisted.web.client import HTTPClientFactory, _makeGetterFactory
from twisted.web.server import NOT_DONE_YET
from scrapy.http.response.text import TextResponse
from scrapy.downloadermiddlewares.decompression import DecompressionMiddleware
from scrapy.selector import Selector
from scrapy.http import Headers
from scrapy.responsetypes import responsetypes
import w3lib.url
import w3lib.html
@ -25,19 +13,6 @@ from settings import DATABASES, DOWNLOADER_USER_AGENT
url_hash_regexp = re.compile('(#.*)?$')
def _getPageFactory(url, contextFactory=None, *args, **kwargs):
"""
Download a web page as a string.
Download a page. Return a deferred, which will callback with a
page (as a string) or errback with a description of the error.
See L{HTTPClientFactory} to see what extra arguments can be passed.
"""
return _makeGetterFactory(
url,
HTTPClientFactory,
contextFactory=contextFactory,
*args, **kwargs)
def element_to_string(element):
s = [element.text] if element.text else []
for sub_element in element:

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-17 14:53-0700\n"
"POT-Creation-Date: 2017-06-26 13:30-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -19,20 +19,36 @@ msgstr ""
#: templates/base.html:12
msgid "meta_desc"
msgstr "Create RSS feed for any webpage you need. All you need is to make several mouse button clicks."
msgstr ""
"Create RSS feed for any webpage you need. All you need is to make several "
"mouse button clicks."
#: templates/base.html:13
msgid "meta_keywords"
msgstr "rss feed generator, create rss, webpage to rss, html to rss, free rss generator, rss builder, create rss feed, create rss online"
msgstr ""
"rss feed generator, create rss, webpage to rss, html to rss, free rss "
"generator, rss builder, create rss feed, create rss online"
#: templates/base.html:92
#: templates/base.html:65 templates/frontend/contact.html:7
msgid "contact"
msgstr "Contacts"
#: templates/base.html:93
msgid "made_by"
msgstr "Made by"
#: templates/base.html:92
#: templates/base.html:93
msgid "made_name"
msgstr "Alexandr Nesterenko"
#: templates/frontend/contact.html:19
msgid "contact.title"
msgstr "Contact us by email:"
#: templates/frontend/contact.html:25
msgid "contact.msg"
msgstr "We will answer ASAP"
#: templates/frontend/index.html:5
msgid "index_title"
msgstr "PolitePol.com: Generate RSS feeds for any web page"
@ -43,7 +59,7 @@ msgstr "Polite Pol"
#: templates/frontend/index.html:16
msgid "hello"
msgstr "Create you feed yourself!"
msgstr "Create your feed yourself!"
#: templates/frontend/index.html:27
msgid "go"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-17 14:53-0700\n"
"POT-Creation-Date: 2017-06-26 13:30-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -21,20 +21,35 @@ msgstr ""
#: templates/base.html:12
msgid "meta_desc"
msgstr "Создать RSS ленту из любой веб страницы в интернете в несколько кликов."
msgstr ""
"Создать RSS ленту из любой веб страницы в интернете в несколько кликов."
#: templates/base.html:13
msgid "meta_keywords"
msgstr "rss генератор, создать rss ленту, создать rss, rss генератор онлайн, генератор rss лент"
msgstr ""
"rss генератор, создать rss ленту, создать rss, rss генератор онлайн, "
"генератор rss лент"
#: templates/base.html:92
#: templates/base.html:65 templates/frontend/contact.html:7
msgid "contact"
msgstr "Контакты"
#: templates/base.html:93
msgid "made_by"
msgstr "Сделал"
#: templates/base.html:92
#: templates/base.html:93
msgid "made_name"
msgstr "Александр Нестеренко"
#: templates/frontend/contact.html:19
msgid "contact.title"
msgstr "Свяжитесь с нами по имэйлу:"
#: templates/frontend/contact.html:25
msgid "contact.msg"
msgstr "Мы ответим как можно скорее"
#: templates/frontend/index.html:5
msgid "index_title"
msgstr "PolitePol.com: Создай RSS канал для любой веб-страницы"

View File

@ -62,6 +62,7 @@
<li>{% if LANGUAGE_CODE == 'en' %} <a href="/ru/" class="lang"><span class="lang">Русский</span></a> {% else %} <span class="lang">Русский</span> {% endif %}
<li class="divider-vertical"></li>
<li><a href="{% url 'contact' %}">{% trans "contact" %}</a></li>
<!--%= render 'devise/menu/login_items' %-->
</ul>
</div>

View File

@ -23,6 +23,7 @@ urlpatterns = i18n_patterns(
url(r'^$', views.index, name='index'),
url(r'^setup$', views.setup, name='setup'),
url(r'^preview/([0-9]+)$', views.preview, name='preview'),
url(r'^contact$', views.contact, name='contact'),
url(r'^admin/', include(admin.site.urls)),
)

View File

@ -33,6 +33,9 @@ def index(request):
return render(request, 'frontend/index.html', {'form': form})
def contact(request):
return render(request, 'frontend/contact.html')
@ensure_csrf_cookie
def setup(request):
if request.method == 'GET' and 'url' in request.GET: