From b465d0bb8ddb7088454693af0ff87b7c230f726c Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Thu, 27 Mar 2025 21:44:21 +0100 Subject: [PATCH 1/7] Remove leftover function binding usages --- src/newsreader/js/components/Messages.js | 4 +--- src/newsreader/js/pages/homepage/components/PostModal.js | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/newsreader/js/components/Messages.js b/src/newsreader/js/components/Messages.js index 3fed5de..e3d776e 100644 --- a/src/newsreader/js/components/Messages.js +++ b/src/newsreader/js/components/Messages.js @@ -3,9 +3,7 @@ import React from 'react'; class Messages extends React.Component { state = { messages: this.props.messages }; - close = ::this.close; - - close(index) { + close = (index) => { const newMessages = this.state.messages.filter((message, currentIndex) => { return currentIndex != index; }); diff --git a/src/newsreader/js/pages/homepage/components/PostModal.js b/src/newsreader/js/pages/homepage/components/PostModal.js index 46410b7..a1a698d 100644 --- a/src/newsreader/js/pages/homepage/components/PostModal.js +++ b/src/newsreader/js/pages/homepage/components/PostModal.js @@ -7,7 +7,6 @@ import { SAVED_TYPE, SUBREDDIT } from '../constants.js'; import { formatDatetime } from '../../../utils.js'; class PostModal extends React.Component { - modalListener = ::this.modalListener; readTimer = null; componentDidMount() { @@ -32,7 +31,7 @@ class PostModal extends React.Component { window.removeEventListener('click', this.modalListener); } - modalListener(e) { + modalListener = (e) => { const targetClassName = e.target.className; if (this.props.post && targetClassName == 'modal post-modal') { From 91a0459186779eadbadd7590bb3ac15c8b9bdef8 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 23 Mar 2025 21:20:21 +0100 Subject: [PATCH 2/7] Initial commit --- docker-compose.yml | 5 -- src/newsreader/conf/base.py | 10 --- src/newsreader/conf/production.py | 5 -- .../js/pages/homepage/components/PostModal.js | 12 +-- .../homepage/components/postlist/PostItem.js | 9 +- src/newsreader/js/pages/homepage/constants.js | 1 - src/newsreader/news/collection/models.py | 8 -- src/newsreader/news/collection/tasks.py | 86 ------------------- 8 files changed, 8 insertions(+), 128 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f29e719..02f1fab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,11 +29,6 @@ x-django-env: &django-env EMAIL_USE_SSL: EMAIL_DEFAULT_FROM: - # Reddit - REDDIT_CLIENT_ID: - REDDIT_CLIENT_SECRET: - REDDIT_CALLBACK_URL: - # Sentry SENTRY_DSN: diff --git a/src/newsreader/conf/base.py b/src/newsreader/conf/base.py index d17234a..5bee027 100644 --- a/src/newsreader/conf/base.py +++ b/src/newsreader/conf/base.py @@ -209,16 +209,6 @@ STATICFILES_FINDERS = [ # Email EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" -# Reddit integration -REDDIT_CLIENT_ID = "CLIENT_ID" -REDDIT_CLIENT_SECRET = "CLIENT_SECRET" -REDDIT_REDIRECT_URL = ( - "http://127.0.0.1:8000/accounts/settings/integrations/reddit/callback/" -) - -# Twitter integration -TWITTER_URL = "https://twitter.com" - # Third party settings AXES_HANDLER = "axes.handlers.cache.AxesCacheHandler" AXES_CACHE = "axes" diff --git a/src/newsreader/conf/production.py b/src/newsreader/conf/production.py index 8615aa2..ea22f30 100644 --- a/src/newsreader/conf/production.py +++ b/src/newsreader/conf/production.py @@ -48,11 +48,6 @@ EMAIL_USE_SSL = bool(os.environ.get("EMAIL_USE_SSL")) VERSION = get_current_version(debug=False) ENVIRONMENT = "production" -# Reddit integration -REDDIT_CLIENT_ID = os.environ.get("REDDIT_CLIENT_ID", "") -REDDIT_CLIENT_SECRET = os.environ.get("REDDIT_CLIENT_SECRET", "") -REDDIT_REDIRECT_URL = os.environ.get("REDDIT_CALLBACK_URL", "") - # Third party settings AXES_HANDLER = "axes.handlers.database.AxesDatabaseHandler" diff --git a/src/newsreader/js/pages/homepage/components/PostModal.js b/src/newsreader/js/pages/homepage/components/PostModal.js index a1a698d..14551b4 100644 --- a/src/newsreader/js/pages/homepage/components/PostModal.js +++ b/src/newsreader/js/pages/homepage/components/PostModal.js @@ -3,7 +3,7 @@ import { connect } from 'react-redux'; import Cookies from 'js-cookie'; import { unSelectPost, markPostRead, toggleSaved } from '../actions/posts.js'; -import { SAVED_TYPE, SUBREDDIT } from '../constants.js'; +import { SAVED_TYPE } from '../constants.js'; import { formatDatetime } from '../../../utils.js'; class PostModal extends React.Component { @@ -25,13 +25,16 @@ class PostModal extends React.Component { if (this.readTimer) { clearTimeout(this.readTimer); } + } + modalListener = (e) => { + const targetClassName = e.target.className; this.readTimer = null; window.removeEventListener('click', this.modalListener); } - modalListener = (e) => { + modalListener(e) { const targetClassName = e.target.className; if (this.props.post && targetClassName == 'modal post-modal') { @@ -53,9 +56,6 @@ class PostModal extends React.Component { let ruleUrl = ''; switch (this.props.rule.type) { - case SUBREDDIT: - ruleUrl = `${this.props.subredditUrl}/${this.props.rule.id}/`; - break; default: ruleUrl = `${this.props.feedUrl}/${this.props.rule.id}/`; break; @@ -69,7 +69,7 @@ class PostModal extends React.Component {
- {% endif %} - - {% if reddit_refresh_url %} - - {% trans "Refresh token" %} - - {% else %} - - {% endif %} - - {% if reddit_revoke_url %} - - {% trans "Deauthorize account" %} - - {% else %} - - {% endif %} -
- - - - -{% endblock %} diff --git a/src/newsreader/accounts/templates/accounts/views/reddit.html b/src/newsreader/accounts/templates/accounts/views/reddit.html deleted file mode 100644 index 9fa8378..0000000 --- a/src/newsreader/accounts/templates/accounts/views/reddit.html +++ /dev/null @@ -1,22 +0,0 @@ -{% extends "sidebar.html" %} -{% load i18n %} - -{% block content %} -
-
-
- {% if error %} -

{% trans "Reddit authorization failed" %}

-

{{ error }}

- {% elif access_token and refresh_token %} -

{% trans "Reddit account is linked" %}

-

{% trans "Your reddit account was successfully linked." %}

- {% endif %} - -

- {% trans "Return to integrations page" %} -

-
-
-
-{% endblock %} diff --git a/src/newsreader/accounts/tests/test_integrations.py b/src/newsreader/accounts/tests/test_integrations.py deleted file mode 100644 index de0b142..0000000 --- a/src/newsreader/accounts/tests/test_integrations.py +++ /dev/null @@ -1,275 +0,0 @@ -from unittest.mock import patch -from urllib.parse import urlencode -from uuid import uuid4 - -from django.core.cache import cache -from django.test import TestCase -from django.urls import reverse - -from bs4 import BeautifulSoup - -from newsreader.accounts.tests.factories import UserFactory -from newsreader.news.collection.exceptions import ( - StreamException, - StreamTooManyException, -) - - -class IntegrationsViewTestCase(TestCase): - def setUp(self): - self.user = UserFactory(email="test@test.nl", password="test") - self.client.force_login(self.user) - - self.url = reverse("accounts:settings:integrations") - - -class RedditIntegrationsTestCase(IntegrationsViewTestCase): - def test_reddit_authorization(self): - self.user.reddit_refresh_token = None - self.user.save() - - response = self.client.get(self.url) - - soup = BeautifulSoup(response.content, features="lxml") - button = soup.find("a", class_="link button button--reddit") - - self.assertEquals(button.text.strip(), "Authorize account") - - def test_reddit_refresh_token(self): - self.user.reddit_refresh_token = "jadajadajada" - self.user.reddit_access_token = None - self.user.save() - - response = self.client.get(self.url) - - soup = BeautifulSoup(response.content, features="lxml") - button = soup.find("a", class_="link button button--reddit") - - self.assertEquals(button.text.strip(), "Refresh token") - - def test_reddit_revoke(self): - self.user.reddit_refresh_token = "jadajadajada" - self.user.reddit_access_token = None - self.user.save() - - response = self.client.get(self.url) - - soup = BeautifulSoup(response.content, features="lxml") - buttons = soup.find_all("a", class_="link button button--reddit") - - self.assertIn( - "Deauthorize account", [button.text.strip() for button in buttons] - ) - - -class RedditTemplateViewTestCase(TestCase): - def setUp(self): - self.user = UserFactory(email="test@test.nl", password="test") - self.client.force_login(self.user) - - self.base_url = reverse("accounts:settings:reddit-template") - self.state = str(uuid4()) - - self.patch = patch("newsreader.news.collection.reddit.post") - self.mocked_post = self.patch.start() - - def tearDown(self): - patch.stopall() - - def test_simple(self): - response = self.client.get(self.base_url) - - self.assertEquals(response.status_code, 200) - self.assertContains(response, "Return to integrations page") - - def test_successful_authorization(self): - self.mocked_post.return_value.json.return_value = { - "access_token": "1001010412", - "refresh_token": "134510143", - } - - cache.set(f"{self.user.email}-reddit-auth", self.state) - - params = {"state": self.state, "code": "Valid code"} - url = f"{self.base_url}?{urlencode(params)}" - - response = self.client.get(url) - - self.mocked_post.assert_called_once() - - self.assertEquals(response.status_code, 200) - self.assertContains(response, "Your reddit account was successfully linked.") - - self.user.refresh_from_db() - - self.assertEquals(self.user.reddit_access_token, "1001010412") - self.assertEquals(self.user.reddit_refresh_token, "134510143") - - self.assertEquals(cache.get(f"{self.user.email}-reddit-auth"), None) - - def test_error(self): - params = {"error": "Denied authorization"} - - url = f"{self.base_url}?{urlencode(params)}" - - response = self.client.get(url) - - self.assertEquals(response.status_code, 200) - self.assertContains(response, "Denied authorization") - - def test_invalid_state(self): - cache.set(f"{self.user.email}-reddit-auth", str(uuid4())) - - params = {"code": "Valid code", "state": "Invalid state"} - - url = f"{self.base_url}?{urlencode(params)}" - - response = self.client.get(url) - - self.assertEquals(response.status_code, 200) - self.assertContains( - response, "The saved state for Reddit authorization did not match" - ) - - def test_stream_error(self): - self.mocked_post.side_effect = StreamTooManyException - - cache.set(f"{self.user.email}-reddit-auth", self.state) - - params = {"state": self.state, "code": "Valid code"} - url = f"{self.base_url}?{urlencode(params)}" - - response = self.client.get(url) - - self.mocked_post.assert_called_once() - - self.assertEquals(response.status_code, 200) - self.assertContains(response, "Too many requests") - - self.user.refresh_from_db() - - self.assertEquals(self.user.reddit_access_token, None) - self.assertEquals(self.user.reddit_refresh_token, None) - - self.assertEquals(cache.get(f"{self.user.email}-reddit-auth"), self.state) - - def test_unexpected_json(self): - self.mocked_post.return_value.json.return_value = {"message": "Happy eastern"} - - cache.set(f"{self.user.email}-reddit-auth", self.state) - - params = {"state": self.state, "code": "Valid code"} - url = f"{self.base_url}?{urlencode(params)}" - - response = self.client.get(url) - - self.mocked_post.assert_called_once() - - self.assertEquals(response.status_code, 200) - self.assertContains(response, "Access and refresh token not found in response") - - self.user.refresh_from_db() - - self.assertEquals(self.user.reddit_access_token, None) - self.assertEquals(self.user.reddit_refresh_token, None) - - self.assertEquals(cache.get(f"{self.user.email}-reddit-auth"), self.state) - - -class RedditTokenRedirectViewTestCase(TestCase): - def setUp(self): - self.user = UserFactory(email="test@test.nl", password="test") - self.client.force_login(self.user) - - self.patch = patch("newsreader.accounts.views.integrations.RedditTokenTask") - self.mocked_task = self.patch.start() - - def tearDown(self): - cache.clear() - - def test_simple(self): - response = self.client.get(reverse("accounts:settings:reddit-refresh")) - - self.assertRedirects(response, reverse("accounts:settings:integrations")) - - self.mocked_task.delay.assert_called_once_with(self.user.pk) - - self.assertEquals(1, cache.get(f"{self.user.email}-reddit-refresh")) - - def test_not_active(self): - cache.set(f"{self.user.email}-reddit-refresh", 1) - - response = self.client.get(reverse("accounts:settings:reddit-refresh")) - - self.assertRedirects(response, reverse("accounts:settings:integrations")) - - self.mocked_task.delay.assert_not_called() - - -class RedditRevokeRedirectViewTestCase(TestCase): - def setUp(self): - self.user = UserFactory(email="test@test.nl", password="test") - self.client.force_login(self.user) - - self.patch = patch("newsreader.accounts.views.integrations.revoke_reddit_token") - self.mocked_revoke = self.patch.start() - - def test_simple(self): - self.user.reddit_access_token = "jadajadajada" - self.user.reddit_refresh_token = "jadajadajada" - self.user.save() - - self.mocked_revoke.return_value = True - - response = self.client.get(reverse("accounts:settings:reddit-revoke")) - - self.assertRedirects(response, reverse("accounts:settings:integrations")) - - self.mocked_revoke.assert_called_once_with(self.user) - - self.user.refresh_from_db() - - self.assertEquals(self.user.reddit_access_token, None) - self.assertEquals(self.user.reddit_refresh_token, None) - - def test_no_refresh_token(self): - self.user.reddit_refresh_token = None - self.user.save() - - response = self.client.get(reverse("accounts:settings:reddit-revoke")) - - self.assertRedirects(response, reverse("accounts:settings:integrations")) - - self.mocked_revoke.assert_not_called() - - def test_unsuccessful_response(self): - self.user.reddit_access_token = "jadajadajada" - self.user.reddit_refresh_token = "jadajadajada" - self.user.save() - - self.mocked_revoke.return_value = False - - response = self.client.get(reverse("accounts:settings:reddit-revoke")) - - self.assertRedirects(response, reverse("accounts:settings:integrations")) - - self.user.refresh_from_db() - - self.assertEquals(self.user.reddit_access_token, "jadajadajada") - self.assertEquals(self.user.reddit_refresh_token, "jadajadajada") - - def test_stream_exception(self): - self.user.reddit_access_token = "jadajadajada" - self.user.reddit_refresh_token = "jadajadajada" - self.user.save() - - self.mocked_revoke.side_effect = StreamException - - response = self.client.get(reverse("accounts:settings:reddit-revoke")) - - self.assertRedirects(response, reverse("accounts:settings:integrations")) - - self.user.refresh_from_db() - - self.assertEquals(self.user.reddit_access_token, "jadajadajada") - self.assertEquals(self.user.reddit_refresh_token, "jadajadajada") diff --git a/src/newsreader/accounts/urls.py b/src/newsreader/accounts/urls.py index b363f82..18a9b21 100644 --- a/src/newsreader/accounts/urls.py +++ b/src/newsreader/accounts/urls.py @@ -3,7 +3,6 @@ from django.urls import include, path from newsreader.accounts.views import ( FaviconRedirectView, - IntegrationsView, LoginView, LogoutView, PasswordChangeView, @@ -11,33 +10,11 @@ from newsreader.accounts.views import ( PasswordResetConfirmView, PasswordResetDoneView, PasswordResetView, - RedditRevokeRedirectView, - RedditTemplateView, - RedditTokenRedirectView, SettingsView, ) settings_patterns = [ - # Integrations - path( - "integrations/reddit/callback/", - login_required(RedditTemplateView.as_view()), - name="reddit-template", - ), - path( - "integrations/reddit/refresh/", - login_required(RedditTokenRedirectView.as_view()), - name="reddit-refresh", - ), - path( - "integrations/reddit/revoke/", - login_required(RedditRevokeRedirectView.as_view()), - name="reddit-revoke", - ), - path( - "integrations/", login_required(IntegrationsView.as_view()), name="integrations" - ), # Misc path("favicon/", login_required(FaviconRedirectView.as_view()), name="favicon"), path("", login_required(SettingsView.as_view()), name="home"), diff --git a/src/newsreader/accounts/views/__init__.py b/src/newsreader/accounts/views/__init__.py index e62755c..d20e6bb 100644 --- a/src/newsreader/accounts/views/__init__.py +++ b/src/newsreader/accounts/views/__init__.py @@ -1,11 +1,5 @@ from newsreader.accounts.views.auth import LoginView, LogoutView from newsreader.accounts.views.favicon import FaviconRedirectView -from newsreader.accounts.views.integrations import ( - IntegrationsView, - RedditRevokeRedirectView, - RedditTemplateView, - RedditTokenRedirectView, -) from newsreader.accounts.views.password import ( PasswordChangeView, PasswordResetCompleteView, @@ -20,10 +14,6 @@ __all__ = [ "LoginView", "LogoutView", "FaviconRedirectView", - "IntegrationsView", - "RedditRevokeRedirectView", - "RedditTemplateView", - "RedditTokenRedirectView", "PasswordChangeView", "PasswordResetCompleteView", "PasswordResetConfirmView", diff --git a/src/newsreader/accounts/views/integrations.py b/src/newsreader/accounts/views/integrations.py deleted file mode 100644 index 1235195..0000000 --- a/src/newsreader/accounts/views/integrations.py +++ /dev/null @@ -1,156 +0,0 @@ -import logging - -from django.contrib import messages -from django.core.cache import cache -from django.urls import reverse_lazy -from django.utils.translation import gettext as _ -from django.views.generic import RedirectView, TemplateView - -from newsreader.news.collection.exceptions import StreamException -from newsreader.news.collection.reddit import ( - get_reddit_access_token, - get_reddit_authorization_url, - revoke_reddit_token, -) -from newsreader.news.collection.tasks import RedditTokenTask -from newsreader.utils.views import NavListMixin - - -logger = logging.getLogger(__name__) - - -class IntegrationsView(NavListMixin, TemplateView): - template_name = "accounts/views/integrations.html" - - def get_context_data(self, **kwargs): - return { - **super().get_context_data(**kwargs), - **self.get_reddit_context(**kwargs), - } - - def get_reddit_context(self, **kwargs): - user = self.request.user - reddit_authorization_url = None - reddit_refresh_url = None - - reddit_task_active = cache.get(f"{user.email}-reddit-refresh") - - if ( - user.reddit_refresh_token - and not user.reddit_access_token - and not reddit_task_active - ): - reddit_refresh_url = reverse_lazy("accounts:settings:reddit-refresh") - - if not user.reddit_refresh_token: - reddit_authorization_url = get_reddit_authorization_url(user) - - return { - "reddit_authorization_url": reddit_authorization_url, - "reddit_refresh_url": reddit_refresh_url, - "reddit_revoke_url": ( - reverse_lazy("accounts:settings:reddit-revoke") - if not reddit_authorization_url - else None - ), - } - - -class RedditTemplateView(NavListMixin, TemplateView): - template_name = "accounts/views/reddit.html" - - def get(self, request, *args, **kwargs): - context = self.get_context_data(**kwargs) - - error = request.GET.get("error", None) - state = request.GET.get("state", None) - code = request.GET.get("code", None) - - if error: - return self.render_to_response({**context, "error": error}) - - if not code or not state: - return self.render_to_response(context) - - cached_state = cache.get(f"{request.user.email}-reddit-auth") - - if state != cached_state: - return self.render_to_response( - { - **context, - "error": _( - "The saved state for Reddit authorization did not match" - ), - } - ) - - try: - access_token, refresh_token = get_reddit_access_token(code, request.user) - - return self.render_to_response( - { - **context, - "access_token": access_token, - "refresh_token": refresh_token, - } - ) - except StreamException as e: - return self.render_to_response({**context, "error": str(e)}) - except KeyError: - return self.render_to_response( - { - **context, - "error": _("Access and refresh token not found in response"), - } - ) - - -class RedditTokenRedirectView(RedirectView): - url = reverse_lazy("accounts:settings:integrations") - - def get(self, request, *args, **kwargs): - response = super().get(request, *args, **kwargs) - - user = request.user - task_active = cache.get(f"{user.email}-reddit-refresh") - - if not task_active: - RedditTokenTask.delay(user.pk) - messages.success(request, _("Access token is being retrieved")) - cache.set(f"{user.email}-reddit-refresh", 1, 300) - return response - - messages.error(request, _("Unable to retrieve token")) - return response - - -class RedditRevokeRedirectView(RedirectView): - url = reverse_lazy("accounts:settings:integrations") - - def get(self, request, *args, **kwargs): - response = super().get(request, *args, **kwargs) - - user = request.user - - if not user.reddit_refresh_token: - messages.error(request, _("No reddit account is linked to this account")) - return response - - try: - is_revoked = revoke_reddit_token(user) - except StreamException: - logger.exception(f"Unable to revoke reddit token for {user.pk}") - - messages.error(request, _("Unable to revoke reddit token")) - return response - - if not is_revoked: - messages.error(request, _("Unable to revoke reddit token")) - return response - - user.reddit_access_token = None - user.reddit_refresh_token = None - user.save() - - messages.success(request, _("Reddit account deathorized")) - return response diff --git a/src/newsreader/js/pages/homepage/App.js b/src/newsreader/js/pages/homepage/App.js index 08c0330..e840407 100644 --- a/src/newsreader/js/pages/homepage/App.js +++ b/src/newsreader/js/pages/homepage/App.js @@ -33,7 +33,6 @@ class App extends React.Component { the reddit API docs." - " For example: https://oauth.reddit.com/r/aww" - ) - - -class SubRedditForm(CollectionRuleForm): - url = forms.URLField(max_length=1024, help_text=get_reddit_help_text) - - def clean_url(self): - url = self.cleaned_data["url"] - - if not url.startswith(REDDIT_API_URL): - raise ValidationError(_("This does not look like an Reddit API URL")) - - return url - - def save(self, commit=True): - instance = super().save(commit=False) - - instance.type = RuleTypeChoices.subreddit - - if commit: - instance.save() - self.save_m2m() - - return instance - - class Meta: - model = CollectionRule - fields = ( - "name", - "url", - "favicon", - "category", - "reddit_allow_nfsw", - "reddit_allow_spoiler", - "reddit_allow_viewed", - "reddit_upvotes_min", - "reddit_downvotes_max", - "reddit_comments_min", - ) diff --git a/src/newsreader/news/collection/models.py b/src/newsreader/news/collection/models.py index 1937c0d..e665b16 100644 --- a/src/newsreader/news/collection/models.py +++ b/src/newsreader/news/collection/models.py @@ -48,25 +48,6 @@ class CollectionRule(TimeStampedModel): on_delete=models.CASCADE, ) - # Reddit - reddit_allow_nfsw = models.BooleanField(_("Allow NSFW posts"), default=False) - reddit_allow_spoiler = models.BooleanField(_("Allow spoilers"), default=False) - reddit_allow_viewed = models.BooleanField( - _("Allow already seen posts"), default=True - ) - reddit_upvotes_min = models.PositiveIntegerField( - _("Minimum amount of upvotes"), default=0 - ) - reddit_downvotes_max = models.PositiveIntegerField( - _("Maximum amount of downvotes"), blank=True, null=True - ) - reddit_comments_min = models.PositiveIntegerField( - _("Minimum amount of comments"), default=0 - ) - - # Twitter (legacy) - screen_name = models.CharField(max_length=255, blank=True, null=True) - objects = CollectionRuleQuerySet.as_manager() def __str__(self): @@ -74,11 +55,6 @@ class CollectionRule(TimeStampedModel): @property def update_url(self): - if self.type == RuleTypeChoices.subreddit: - return reverse("news:collection:subreddit-update", kwargs={"pk": self.pk}) - elif self.type == RuleTypeChoices.twitter_timeline: - return "#not-supported" - return reverse("news:collection:feed-update", kwargs={"pk": self.pk}) @property diff --git a/src/newsreader/news/collection/reddit.py b/src/newsreader/news/collection/reddit.py deleted file mode 100644 index 06f363b..0000000 --- a/src/newsreader/news/collection/reddit.py +++ /dev/null @@ -1,419 +0,0 @@ -import logging - -from concurrent.futures import ThreadPoolExecutor, as_completed -from datetime import datetime, timedelta, timezone -from html import unescape -from json.decoder import JSONDecodeError -from urllib.parse import urlencode -from uuid import uuid4 - -from django.conf import settings -from django.core.cache import cache -from django.utils.html import format_html - -import requests - -from newsreader.news.collection.base import ( - PostBuilder, - PostClient, - PostCollector, - PostStream, - Scheduler, -) -from newsreader.news.collection.choices import RuleTypeChoices -from newsreader.news.collection.exceptions import ( - BuilderDuplicateException, - BuilderException, - BuilderMissingDataException, - BuilderParseException, - BuilderSkippedException, - StreamDeniedException, - StreamException, - StreamParseException, - StreamTooManyException, -) -from newsreader.news.collection.models import CollectionRule -from newsreader.news.collection.tasks import RedditTokenTask -from newsreader.news.collection.utils import fetch, post, truncate_text -from newsreader.news.core.models import Post - - -logger = logging.getLogger(__name__) - - -REDDIT_URL = "https://www.reddit.com" -REDDIT_API_URL = "https://oauth.reddit.com" - -RATE_LIMIT = 60 -RATE_LIMIT_DURATION = timedelta(seconds=60) - -REDDIT_IMAGE_EXTENSIONS = (".jpg", ".png", ".gif") -REDDIT_VIDEO_EXTENSIONS = (".mp4", ".gifv", ".webm") - -# see type prefixes on https://www.reddit.com/dev/api/ -REDDIT_POST = "t3" - - -def get_reddit_authorization_url(user): - state = str(uuid4()) - cache.set(f"{user.email}-reddit-auth", state) - - params = { - "client_id": settings.REDDIT_CLIENT_ID, - "redirect_uri": settings.REDDIT_REDIRECT_URL, - "state": state, - "response_type": "code", - "duration": "permanent", - "scope": "identity,mysubreddits,save,read", - } - - authorization_url = f"{REDDIT_URL}/api/v1/authorize" - return f"{authorization_url}?{urlencode(params)}" - - -def get_reddit_access_token(code, user): - client_auth = requests.auth.HTTPBasicAuth( - settings.REDDIT_CLIENT_ID, settings.REDDIT_CLIENT_SECRET - ) - - response = post( - f"{REDDIT_URL}/api/v1/access_token", - data={ - "redirect_uri": settings.REDDIT_REDIRECT_URL, - "grant_type": "authorization_code", - "code": code, - }, - auth=client_auth, - ) - - response_data = response.json() - - user.reddit_access_token = response_data["access_token"] - user.reddit_refresh_token = response_data["refresh_token"] - user.save() - - cache.delete(f"{user.email}-reddit-auth") - - return response_data["access_token"], response_data["refresh_token"] - - -# Note that the API always returns 204's with correct basic auth headers -def revoke_reddit_token(user): - client_auth = requests.auth.HTTPBasicAuth( - settings.REDDIT_CLIENT_ID, settings.REDDIT_CLIENT_SECRET - ) - - response = post( - f"{REDDIT_URL}/api/v1/revoke_token", - data={"token": user.reddit_refresh_token, "token_type_hint": "refresh_token"}, - auth=client_auth, - ) - - return response.status_code == 204 - - -class RedditBuilder(PostBuilder): - rule_type = RuleTypeChoices.subreddit - - def build(self): - results = {} - - if "data" not in self.payload or "children" not in self.payload["data"]: - return - - entries = self.payload["data"]["children"] - - for entry in entries: - try: - post = self.build_post(entry) - except BuilderDuplicateException: - logger.warning("Skipping duplicate post") - continue - except BuilderSkippedException as e: - logger.warning(e.message) - continue - except BuilderException: - logger.exception("Failed building post") - continue - - identifier = post.remote_identifier - results[identifier] = post - - self.instances = results.values() - - def build_post(self, entry): - rule = self.stream.rule - entry_data = entry.get("data", {}) - remote_identifier = entry_data.get("id", "") - kind = entry.get("kind") - - if remote_identifier in self.existing_posts: - raise BuilderDuplicateException(payload=entry) - elif kind != REDDIT_POST: - raise BuilderParseException( - message=f"Payload is not an reddit post, its of kind {kind}", - payload=entry, - ) - elif not entry_data: - raise BuilderMissingDataException( - message=f"Post {remote_identifier} did not contain any data", - payload=entry, - ) - - try: - title = entry_data["title"] - author = entry_data["author"] - - post_url_fragment = entry_data["permalink"] - direct_url = entry_data["url"] - - is_text = entry_data["is_self"] - is_video = entry_data["is_video"] - - is_nsfw = entry_data["over_18"] - is_spoiler = entry_data["spoiler"] - is_viewed = entry_data["clicked"] - upvotes = entry_data["ups"] - downvotes = entry_data["downs"] - comments = entry_data["num_comments"] - except KeyError as e: - raise BuilderMissingDataException(payload=entry) from e - - if not rule.reddit_allow_nfsw and is_nsfw: - raise BuilderSkippedException("Rule does not allow NSFW posts") - elif not rule.reddit_allow_spoiler and is_spoiler: - raise BuilderSkippedException("Rule does not allow spoilers") - elif not rule.reddit_allow_viewed and is_viewed: - raise BuilderSkippedException("Post was already seen by user") - elif not upvotes >= rule.reddit_upvotes_min: - raise BuilderSkippedException( - "Post does not meet minimum amount of upvotes" - ) - elif ( - rule.reddit_downvotes_max is not None - and downvotes > rule.reddit_downvotes_max - ): - raise BuilderSkippedException("Post has more downvotes than allowed") - elif not comments >= rule.reddit_comments_min: - raise BuilderSkippedException("Post does not have enough comments") - - title = truncate_text(Post, "title", title) - author = truncate_text(Post, "author", author) - - if is_text: - body = self.get_text_post(entry_data) - elif direct_url.endswith(REDDIT_IMAGE_EXTENSIONS): - body = self.get_image_post(title, direct_url) - elif is_video: - body = self.get_native_video_post(entry_data) - elif direct_url.endswith(REDDIT_VIDEO_EXTENSIONS): - body = self.get_video_post(direct_url) - else: - body = self.get_url_post(title, direct_url) - - try: - _created_date = datetime.fromtimestamp(entry_data["created_utc"]) - created_date = _created_date.replace(tzinfo=timezone.utc) - except (OverflowError, OSError) as e: - raise BuilderParseException(payload=entry) from e - except KeyError as e: - raise BuilderMissingDataException(payload=entry) from e - - post_entry = { - "remote_identifier": remote_identifier, - "title": title, - "body": body, - "author": author, - "url": f"{REDDIT_URL}{post_url_fragment}", - "publication_date": created_date, - "rule": rule, - } - - return Post(**post_entry) - - def get_text_post(self, entry): - try: - uncleaned_body = entry["selftext_html"] - except KeyError as e: - raise BuilderMissingDataException(payload=entry) from e - - unescaped_body = unescape(uncleaned_body) if uncleaned_body else "" - return self.sanitize_fragment(unescaped_body) if unescaped_body else "" - - def get_image_post(self, title, url): - return format_html( - "
{title}
", - url=url, - title=title, - ) - - def get_native_video_post(self, entry): - try: - video_info = entry["secure_media"]["reddit_video"] - except KeyError as e: - raise BuilderMissingDataException(payload=entry) from e - - return format_html( - "
", - url=video_info["fallback_url"], - ) - - def get_video_post(self, url): - extension = next( - extension.replace(".", "") - for extension in REDDIT_VIDEO_EXTENSIONS - if url.endswith(extension) - ) - - if extension == "gifv": - return format_html( - "
", - url=url.replace(extension, "mp4"), - ) - - return format_html( - "
", - url=url, - extension=extension, - ) - - def get_url_post(self, title, url): - return format_html( - "", - url=url, - title=title, - ) - - def __str__(self): - return f"{self.stream.rule.pk}: RedditBuilder" - - -class RedditStream(PostStream): - rule_type = RuleTypeChoices.subreddit - headers = {} - - def __init__(self, rule): - super().__init__(rule) - - self.headers = {"Authorization": f"bearer {self.rule.user.reddit_access_token}"} - - def read(self): - response = fetch(self.rule.url, headers=self.headers) - - return self.parse(response), self - - def parse(self, response): - try: - return response.json() - except JSONDecodeError as e: - raise StreamParseException( - response=response, message="Failed parsing json" - ) from e - - def __str__(self): - return f"{self.rule.pk}: RedditStream" - - -class RedditClient(PostClient): - stream = RedditStream - - def __enter__(self): - streams = [[self.stream(rule) for rule in batch] for batch in self.rules] - rate_limitted = False - - with ThreadPoolExecutor(max_workers=10) as executor: - for batch in streams: - futures = {executor.submit(stream.read): stream for stream in batch} - - if rate_limitted: - logger.warning("Aborting requests, ratelimit hit") - break - - for future in as_completed(futures): - stream = futures[future] - - try: - response_data = future.result() - - stream.rule.error = None - stream.rule.succeeded = True - - yield response_data - except StreamDeniedException as e: - logger.warning( - f"Access token expired for user {stream.rule.user.pk}" - ) - - stream.rule.user.reddit_access_token = None - stream.rule.user.save() - - self.set_rule_error(stream.rule, e) - - RedditTokenTask.delay(stream.rule.user.pk) - - break - except StreamTooManyException as e: - logger.exception("Ratelimit hit, aborting batched subreddits") - - self.set_rule_error(stream.rule, e) - - rate_limitted = True - break - except StreamException as e: - logger.exception( - f"Stream failed reading content from {stream.rule.url}" - ) - - self.set_rule_error(stream.rule, e) - - continue - finally: - stream.rule.last_run = datetime.now(tz=timezone.utc) - stream.rule.save() - - -class RedditCollector(PostCollector): - builder = RedditBuilder - client = RedditClient - - -class RedditScheduler(Scheduler): - max_amount = RATE_LIMIT - max_user_amount = RATE_LIMIT / 4 - - def __init__(self, subreddits=[]): - if not subreddits: - self.subreddits = CollectionRule.objects.filter( - type=RuleTypeChoices.subreddit, - user__reddit_access_token__isnull=False, - user__reddit_refresh_token__isnull=False, - enabled=True, - ).order_by("last_run")[:200] - else: - self.subreddits = subreddits - - def get_scheduled_rules(self): - rule_mapping = {} - current_amount = 0 - - for subreddit in self.subreddits: - user_pk = subreddit.user.pk - - if current_amount == self.max_amount: - break - - if user_pk in rule_mapping: - max_amount_reached = len(rule_mapping[user_pk]) == self.max_user_amount - - if max_amount_reached: - continue - - rule_mapping[user_pk].append(subreddit) - current_amount += 1 - - continue - - rule_mapping[user_pk] = [subreddit] - current_amount += 1 - - return list(rule_mapping.values()) diff --git a/src/newsreader/news/collection/tasks.py b/src/newsreader/news/collection/tasks.py index 61d163d..f397244 100644 --- a/src/newsreader/news/collection/tasks.py +++ b/src/newsreader/news/collection/tasks.py @@ -66,15 +66,6 @@ class FaviconTask(app.Task): collector = FaviconCollector() collector.collect(rules=rules) - - third_party_rules = user.rules.enabled().exclude( - type=RuleTypeChoices.feed - ) - - for rule in third_party_rules: - if rule.type == RuleTypeChoices.subreddit: - rule.favicon = "https://www.reddit.com/favicon.ico" - rule.save() else: logger.warning("Cancelling task due to existing lock") diff --git a/src/newsreader/news/collection/templates/news/collection/views/rules.html b/src/newsreader/news/collection/templates/news/collection/views/rules.html index 2430e31..de8f6c9 100644 --- a/src/newsreader/news/collection/templates/news/collection/views/rules.html +++ b/src/newsreader/news/collection/templates/news/collection/views/rules.html @@ -2,139 +2,129 @@ {% load i18n static filters %} {% block content %} -
-
-
- {% csrf_token %} +
+
+ + {% csrf_token %} -
- -
- -
-
- - - -
-
- -
- - - - - - - - - - - - - {% for rule in rules %} - - - - - - - - - - - - - - {% endfor %} - -
- {% include "components/form/checkbox.html" with id="select-all" data_input="rules" id_for_label="select-all" %} - {% trans "Name" %}{% trans "Category" %}{% trans "URL" %}{% trans "Successfuly ran" %}{% trans "Enabled" %}
- {% with rule|id_for_label:"rules" as id_for_label %} - {% include "components/form/checkbox.html" with name="rules" value=rule.pk id=id_for_label id_for_label=id_for_label %} - {% endwith %} - - - {{ rule.name }} - - - {% if rule.category %} - - {{ rule.category.name }} - - {% endif %} - - - {{ rule.source_url }} - - - {% if rule.failed %} - - {% else %} - - {% endif %} - - {% if rule.enabled %} - - {% else %} - - {% endif %} -
-
- - -
+
+
{% endblock %} diff --git a/src/newsreader/news/collection/templates/news/collection/views/subreddit-create.html b/src/newsreader/news/collection/templates/news/collection/views/subreddit-create.html deleted file mode 100644 index f28d578..0000000 --- a/src/newsreader/news/collection/templates/news/collection/views/subreddit-create.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "sidebar.html" %} -{% load static %} - - -{% block content %} - {% url "news:collection:rules" as cancel_url %} - -
-
- {% include "components/form/form.html" with form=form title="Add a subreddit" cancel_url=cancel_url confirm_text="Add subrredit" %} -
-
-{% endblock %} diff --git a/src/newsreader/news/collection/templates/news/collection/views/subreddit-update.html b/src/newsreader/news/collection/templates/news/collection/views/subreddit-update.html deleted file mode 100644 index 0099e3b..0000000 --- a/src/newsreader/news/collection/templates/news/collection/views/subreddit-update.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "base.html" %} -{% load static i18n %} - -{% block content %} -
- {% if subreddit.error %} - {% trans "Failed to retrieve posts" as title %} - {% include "components/textbox/textbox.html" with title=title body=subreddit.error class="text-section--error" only %} - {% endif %} - - {% url "news:collection:rules" as cancel_url %} - {% include "components/form/form.html" with form=form title="Update subreddit" cancel_url=cancel_url confirm_text="Save subreddit" %} -
-{% endblock %} diff --git a/src/newsreader/news/collection/tests/factories.py b/src/newsreader/news/collection/tests/factories.py index fdf786f..1f80a98 100644 --- a/src/newsreader/news/collection/tests/factories.py +++ b/src/newsreader/news/collection/tests/factories.py @@ -3,7 +3,6 @@ import factory from newsreader.accounts.tests.factories import UserFactory from newsreader.news.collection.choices import RuleTypeChoices from newsreader.news.collection.models import CollectionRule -from newsreader.news.collection.reddit import REDDIT_URL class CollectionRuleFactory(factory.django.DjangoModelFactory): @@ -23,8 +22,3 @@ class CollectionRuleFactory(factory.django.DjangoModelFactory): class FeedFactory(CollectionRuleFactory): type = RuleTypeChoices.feed - - -class SubredditFactory(CollectionRuleFactory): - type = RuleTypeChoices.subreddit - website_url = REDDIT_URL diff --git a/src/newsreader/news/collection/tests/reddit/__init__.py b/src/newsreader/news/collection/tests/reddit/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/newsreader/news/collection/tests/reddit/builder/__init__.py b/src/newsreader/news/collection/tests/reddit/builder/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/newsreader/news/collection/tests/reddit/builder/mocks.py b/src/newsreader/news/collection/tests/reddit/builder/mocks.py deleted file mode 100644 index 4130d0c..0000000 --- a/src/newsreader/news/collection/tests/reddit/builder/mocks.py +++ /dev/null @@ -1,5246 +0,0 @@ -simple_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 8, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 9, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 2, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 2, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 544037, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_gr7k5", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Here's a feature Linux could borrow from BSD: in-kernel debugger with built-in hangman game", - "link_flair_richtext": [{"e": "text", "t": "Fluff"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hngs71", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.9, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 158, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Fluff", - "can_mod_post": False, - "score": 158, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594242629.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/wmc8tp2ium951.jpg", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "af8918be-6777-11e7-8273-0e925d908786", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#9a2bff", - "id": "hngs71", - "is_robot_indexable": True, - "report_reasons": None, - "author": "the_humeister", - "discussion_type": None, - "num_comments": 21, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hngs71/heres_a_feature_linux_could_borrow_from_bsd/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/wmc8tp2ium951.jpg", - "subreddit_subscribers": 544037, - "created_utc": 1594213829.0, - "num_crossposts": 1, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_k9f35", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "KeePassXC 2.6.0 released", - "link_flair_richtext": [{"e": "text", "t": "Software Release"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hngsj8", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.97, - "author_flair_background_color": "transparent", - "subreddit_type": "public", - "ups": 151, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": "fa602e36-cdf6-11e8-93c9-0e41ac35f4cc", - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Software Release", - "can_mod_post": False, - "score": 151, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [ - { - "a": ":ubuntu:", - "e": "emoji", - "u": "https://emoji.redditmedia.com/uwmddx7qqpr11_t5_2qh1a/ubuntu", - } - ], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594242666.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "keepassxc.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://keepassxc.org/blog/2020-07-07-2.6.0-released/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "904ea3e4-6748-11e7-b925-0ef3dfbb807a", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": ":ubuntu:", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#349e48", - "id": "hngsj8", - "is_robot_indexable": True, - "report_reasons": None, - "author": "nixcraft", - "discussion_type": None, - "num_comments": 46, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/linux/comments/hngsj8/keepassxc_260_released/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://keepassxc.org/blog/2020-07-07-2.6.0-released/", - "subreddit_subscribers": 544037, - "created_utc": 1594213866.0, - "num_crossposts": 1, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [{"e": "text", "t": "Popular Application"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd7cy", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.95, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 226, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Popular Application", - "can_mod_post": False, - "score": 226, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "crosspost_parent_list": [ - { - "approved_at_utc": None, - "subreddit": "libreoffice", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/libreoffice", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd6yo", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.96, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 29, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "News", - "can_mod_post": False, - "score": 29, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594224961.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "dc82ac98-bafb-11e4-9f88-22000b310327", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2s4nt", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnd6yo", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZero", - "discussion_type": None, - "num_comments": 38, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/libreoffice/comments/hnd6yo/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 4669, - "created_utc": 1594196161.0, - "num_crossposts": 2, - "media": None, - "is_video": False, - } - ], - "created": 1594225018.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "7127ec98-5859-11e8-9488-0e8717893ec8", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#0aa18f", - "id": "hnd7cy", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZero", - "discussion_type": None, - "num_comments": 120, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_hnd6yo", - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnd7cy/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 544037, - "created_utc": 1594196218.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmytic", - "before": None, - }, -} - -empty_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [], - "after": "t3_hmytic", - "before": None, - }, -} - -unsanitized_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [{"e": "text", "t": "Popular Application"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd7cy", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.95, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 226, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Popular Application", - "can_mod_post": False, - "score": 226, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "crosspost_parent_list": [ - { - "approved_at_utc": None, - "subreddit": "libreoffice", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/libreoffice", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd6yo", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.96, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 29, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "News", - "can_mod_post": False, - "score": 29, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594224961.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "dc82ac98-bafb-11e4-9f88-22000b310327", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2s4nt", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnd6yo", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZero", - "discussion_type": None, - "num_comments": 38, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/libreoffice/comments/hnd6yo/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 4669, - "created_utc": 1594196161.0, - "num_crossposts": 2, - "media": None, - "is_video": False, - } - ], - "created": 1594225018.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": "
", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "7127ec98-5859-11e8-9488-0e8717893ec8", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#0aa18f", - "id": "hnd7cy", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZero", - "discussion_type": None, - "num_comments": 120, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_hnd6yo", - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnd7cy/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 544037, - "created_utc": 1594196218.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - } - ], - "after": "t3_hmytic", - "before": None, - }, -} - -author_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [{"e": "text", "t": "Popular Application"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd7cy", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.95, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 226, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Popular Application", - "can_mod_post": False, - "score": 226, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "crosspost_parent_list": [ - { - "approved_at_utc": None, - "subreddit": "libreoffice", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/libreoffice", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd6yo", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.96, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 29, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "News", - "can_mod_post": False, - "score": 29, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594224961.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "dc82ac98-bafb-11e4-9f88-22000b310327", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2s4nt", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnd6yo", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZero", - "discussion_type": None, - "num_comments": 38, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/libreoffice/comments/hnd6yo/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 4669, - "created_utc": 1594196161.0, - "num_crossposts": 2, - "media": None, - "is_video": False, - } - ], - "created": 1594225018.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": "
", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "7127ec98-5859-11e8-9488-0e8717893ec8", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#0aa18f", - "id": "hnd7cy", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZeroTheQuantumZeroTheQuantumZero", - "discussion_type": None, - "num_comments": 120, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_hnd6yo", - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnd7cy/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 544037, - "created_utc": 1594196218.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - } - ], - "after": "t3_hmytic", - "before": None, - }, -} - -title_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal EditionBoard statement on the LibreOffice 7.0 RC "Personal Edition" label" labelBoard statement on the LibreOffice 7.0 RC "PersBoard statement on the LibreOffice 7.0 RC "Personal Edition" labelonal Edition" label', - "link_flair_richtext": [{"e": "text", "t": "Popular Application"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd7cy", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.95, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 226, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Popular Application", - "can_mod_post": False, - "score": 226, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "crosspost_parent_list": [ - { - "approved_at_utc": None, - "subreddit": "libreoffice", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/libreoffice", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd6yo", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.96, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 29, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "News", - "can_mod_post": False, - "score": 29, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594224961.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "dc82ac98-bafb-11e4-9f88-22000b310327", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2s4nt", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnd6yo", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZero", - "discussion_type": None, - "num_comments": 38, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/libreoffice/comments/hnd6yo/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 4669, - "created_utc": 1594196161.0, - "num_crossposts": 2, - "media": None, - "is_video": False, - } - ], - "created": 1594225018.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": "
", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "7127ec98-5859-11e8-9488-0e8717893ec8", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#0aa18f", - "id": "hnd7cy", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZeroTheQuantumZeroTheQuantumZero", - "discussion_type": None, - "num_comments": 120, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_hnd6yo", - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnd7cy/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 544037, - "created_utc": 1594196218.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - } - ], - "after": "t3_hmytic", - "before": None, - }, -} - -duplicate_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 8, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 9, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 2, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 2, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 544037, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 8, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 9, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmytic", - "before": None, - }, -} - -image_mock = { - "data": { - "after": "t3_hr3mhe", - "before": None, - "children": [ - { - "data": { - "all_awardings": [], - "allow_live_comments": True, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "SamLynn79", - "author_flair_background_color": None, - "author_flair_css_class": None, - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": None, - "author_flair_type": "text", - "author_fullname": "t2_6c9cj", - "author_patreon_flair": False, - "author_premium": True, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594777552.0, - "created_utc": 1594748752.0, - "discussion_type": None, - "distinguished": None, - "domain": "i.redd.it", - "downs": 0, - "edited": False, - "gilded": 1, - "gildings": {"gid_2": 1}, - "hidden": False, - "hide_score": False, - "id": "hr64xh", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": True, - "is_robot_indexable": True, - "is_self": False, - "is_video": False, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": None, - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": True, - "media": None, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hr64xh", - "no_follow": False, - "num_comments": 579, - "num_crossposts": 2, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hr64xh/yall_i_just_cant_this_is_my_son_judah_my_wife_and/", - "pinned": False, - "post_hint": "image", - "preview": { - "enabled": True, - "images": [ - { - "id": "xWBh4hObZx0zmG_IDOHBLNN-_NZzEss2dAgm1sm9p1w", - "resolutions": [ - { - "height": 135, - "url": "https://preview.redd.it/cm2qybia1va51.jpg?width=108&crop=smart&auto=webp&s=5374b8f3dff520eba8cf97b589ebc67206f130dc", - "width": 108, - }, - { - "height": 270, - "url": "https://preview.redd.it/cm2qybia1va51.jpg?width=216&crop=smart&auto=webp&s=09d937a8db6f843d9fd34ee024cdfc6432dc0a13", - "width": 216, - }, - { - "height": 400, - "url": "https://preview.redd.it/cm2qybia1va51.jpg?width=320&crop=smart&auto=webp&s=9ba3654c12cb54f6d9c2dce1b07c80ecd6ca9d06", - "width": 320, - }, - { - "height": 800, - "url": "https://preview.redd.it/cm2qybia1va51.jpg?width=640&crop=smart&auto=webp&s=8c53747ae0f92b65fdd41f3aab60ebb8f8d4b1ca", - "width": 640, - }, - { - "height": 1200, - "url": "https://preview.redd.it/cm2qybia1va51.jpg?width=960&crop=smart&auto=webp&s=5668a626da6cd69e23b6c01587783c6cc5817bea", - "width": 960, - }, - { - "height": 1350, - "url": "https://preview.redd.it/cm2qybia1va51.jpg?width=1080&crop=smart&auto=webp&s=8fdd61aed8718109f3739cb532d96be31192b9a0", - "width": 1080, - }, - ], - "source": { - "height": 1800, - "url": "https://preview.redd.it/cm2qybia1va51.jpg?auto=webp&s=17b817b8d0e35bddc7f605d242cd7d116ef8e235", - "width": 1440, - }, - "variants": {}, - } - ], - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 23419, - "secure_media": None, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": True, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": None, - "thumbnail": "https://b.thumbs.redditmedia.com/0X39S2jBL66zQCUbJAtlRKeswI8uUxf3-7vmog0VLjc.jpg", - "thumbnail_height": 140, - "thumbnail_width": 140, - "title": "Ya’ll, I just can’t... this is my " - "son, Judah. My wife and I have no " - "idea how we created such a " - "beautiful child.", - "top_awarded_type": None, - "total_awards_received": 4, - "treatment_tags": [], - "ups": 23419, - "upvote_ratio": 0.72, - "url": "https://i.redd.it/cm2qybia1va51.jpg", - "url_overridden_by_dest": "https://i.redd.it/cm2qybia1va51.jpg", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - { - "data": { - "all_awardings": [], - "allow_live_comments": True, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "0_GG_0", - "author_flair_background_color": None, - "author_flair_css_class": None, - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": None, - "author_flair_type": "text", - "author_fullname": "t2_70k94sn8", - "author_patreon_flair": False, - "author_premium": True, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594771808.0, - "created_utc": 1594743008.0, - "discussion_type": None, - "distinguished": None, - "domain": "i.redd.it", - "downs": 0, - "edited": False, - "gilded": 0, - "gildings": {}, - "hidden": False, - "hide_score": False, - "id": "hr4bxo", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": True, - "is_robot_indexable": True, - "is_self": False, - "is_video": False, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": "lc", - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": False, - "media": None, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hr4bxo", - "no_follow": False, - "num_comments": 248, - "num_crossposts": 4, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hr4bxo/just_thought_yall_would_enjoy_my_goat_dressed_as/", - "pinned": False, - "post_hint": "image", - "preview": { - "enabled": True, - "images": [ - { - "id": "TSXyc6ZJGdCcHk7-wuWnJdVpqsa_t8hmVd4k_e3ofCA", - "resolutions": [ - { - "height": 144, - "url": "https://preview.redd.it/4udujbu6kua51.jpg?width=108&crop=smart&auto=webp&s=ed5a11a7637acc66de48e30fd51d5019fa0c69f7", - "width": 108, - }, - { - "height": 288, - "url": "https://preview.redd.it/4udujbu6kua51.jpg?width=216&crop=smart&auto=webp&s=a812bec268d8ea31dbb9dfe696e0798490538f5a", - "width": 216, - }, - { - "height": 426, - "url": "https://preview.redd.it/4udujbu6kua51.jpg?width=320&crop=smart&auto=webp&s=1be4e3bdea19243b0a627bacb4c9e04f2d3569a7", - "width": 320, - }, - { - "height": 853, - "url": "https://preview.redd.it/4udujbu6kua51.jpg?width=640&crop=smart&auto=webp&s=e73755c3f0b27bb0435d07aa60b32e091bed7957", - "width": 640, - }, - { - "height": 1280, - "url": "https://preview.redd.it/4udujbu6kua51.jpg?width=960&crop=smart&auto=webp&s=8ab6972fffc4786503284a0253e91e9104f2d01e", - "width": 960, - }, - { - "height": 1440, - "url": "https://preview.redd.it/4udujbu6kua51.jpg?width=1080&crop=smart&auto=webp&s=a1e554889179a7599786985679304fda706d83d6", - "width": 1080, - }, - ], - "source": { - "height": 4032, - "url": "https://preview.redd.it/4udujbu6kua51.jpg?auto=webp&s=3eefdef653e0a3a8a10090b804f0888ee6a1a163", - "width": 3024, - }, - "variants": {}, - } - ], - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 16684, - "secure_media": None, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": True, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": None, - "thumbnail": "https://b.thumbs.redditmedia.com/h3Ylp4kb0uJzAsST4ZZGsGN8WGxK4wjK2XrM9uUH5uc.jpg", - "thumbnail_height": 140, - "thumbnail_width": 140, - "title": "Just thought y’all would enjoy my " - "goat dressed as a tractor", - "top_awarded_type": None, - "total_awards_received": 2, - "treatment_tags": [], - "ups": 16684, - "upvote_ratio": 0.98, - "url": "https://i.redd.it/4udujbu6kua51.jpg", - "url_overridden_by_dest": "https://i.redd.it/4udujbu6kua51.jpg", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - { - "data": { - "all_awardings": [], - "allow_live_comments": True, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "Mechanic619", - "author_flair_background_color": None, - "author_flair_css_class": None, - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": None, - "author_flair_type": "text", - "author_fullname": "t2_4ptrdtz5", - "author_patreon_flair": False, - "author_premium": False, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594760700.0, - "created_utc": 1594731900.0, - "discussion_type": None, - "distinguished": None, - "domain": "i.redd.it", - "downs": 0, - "edited": False, - "gilded": 0, - "gildings": {"gid_1": 1}, - "hidden": False, - "hide_score": False, - "id": "hr14y5", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": True, - "is_robot_indexable": True, - "is_self": False, - "is_video": False, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": "lc", - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": False, - "media": None, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hr14y5", - "no_follow": False, - "num_comments": 1439, - "num_crossposts": 20, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hr14y5/mosque_security_on_patrol/", - "pinned": False, - "post_hint": "image", - "preview": { - "enabled": True, - "images": [ - { - "id": "Qs_FmhJgYT8GWyxmDQ8kjBCs_w2V_77cvHvdqLJ7i4s", - "resolutions": [ - { - "height": 135, - "url": "https://preview.redd.it/jk08ge66nta51.jpg?width=108&crop=smart&auto=webp&s=cf4c24ef4f9be86d186c143296bd1e14f15f960a", - "width": 108, - }, - { - "height": 270, - "url": "https://preview.redd.it/jk08ge66nta51.jpg?width=216&crop=smart&auto=webp&s=308e2367a849334c32b579265ed738d9937bed71", - "width": 216, - }, - { - "height": 400, - "url": "https://preview.redd.it/jk08ge66nta51.jpg?width=320&crop=smart&auto=webp&s=bc890f054dc34bb3f8607a70d088926afe113ff1", - "width": 320, - }, - { - "height": 800, - "url": "https://preview.redd.it/jk08ge66nta51.jpg?width=640&crop=smart&auto=webp&s=e23a9bc2d8d1ac6ccefab7f30cfa9def741aaa25", - "width": 640, - }, - { - "height": 1201, - "url": "https://preview.redd.it/jk08ge66nta51.jpg?width=960&crop=smart&auto=webp&s=4d294d1626046d27edc2a281c21ab10502b9ca4c", - "width": 960, - }, - { - "height": 1351, - "url": "https://preview.redd.it/jk08ge66nta51.jpg?width=1080&crop=smart&auto=webp&s=a801e5d9d703204e8b1497d3038d6405b2ed1157", - "width": 1080, - }, - ], - "source": { - "height": 1413, - "url": "https://preview.redd.it/jk08ge66nta51.jpg?auto=webp&s=f4e87e2ad0f0e40ca4f7a08c2a894b234601f3ce", - "width": 1129, - }, - "variants": {}, - } - ], - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 89133, - "secure_media": None, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": True, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": None, - "thumbnail": "https://b.thumbs.redditmedia.com/GGHjIElMHDgefR0UdMXVk8CHeDUBhuZMY_QHjls4ynA.jpg", - "thumbnail_height": 140, - "thumbnail_width": 140, - "title": "Mosque security on patrol", - "top_awarded_type": None, - "total_awards_received": 3, - "treatment_tags": [], - "ups": 89133, - "upvote_ratio": 0.93, - "url": "https://i.redd.it/jk08ge66nta51.jpg", - "url_overridden_by_dest": "https://i.redd.it/jk08ge66nta51.jpg", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - { - "data": { - "all_awardings": [], - "allow_live_comments": False, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "Amnesia19", - "author_cakeday": True, - "author_flair_background_color": None, - "author_flair_css_class": None, - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": None, - "author_flair_type": "text", - "author_fullname": "t2_1rqe7gk1", - "author_patreon_flair": False, - "author_premium": False, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594765470.0, - "created_utc": 1594736670.0, - "discussion_type": None, - "distinguished": None, - "domain": "i.redd.it", - "downs": 0, - "edited": False, - "gilded": 0, - "gildings": {}, - "hidden": False, - "hide_score": False, - "id": "hr2fv0", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": True, - "is_robot_indexable": True, - "is_self": False, - "is_video": False, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": None, - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": False, - "media": None, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hr2fv0", - "no_follow": False, - "num_comments": 71, - "num_crossposts": 1, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hr2fv0/the_look_my_dog_gives_my_grandpa/", - "pinned": False, - "post_hint": "image", - "preview": { - "enabled": True, - "images": [ - { - "id": "v0BbkKy6haXmUxmHz4oXygoR0E-cHkvZDACWL_s7STw", - "resolutions": [ - { - "height": 144, - "url": "https://preview.redd.it/y6q7bgzc1ua51.jpg?width=108&crop=smart&auto=webp&s=4e65e8ff55c02de0ebe79763c91fe43f51216717", - "width": 108, - }, - { - "height": 288, - "url": "https://preview.redd.it/y6q7bgzc1ua51.jpg?width=216&crop=smart&auto=webp&s=e2006e5fe7ac43f911c17dc7f185f33db24e3b52", - "width": 216, - }, - { - "height": 426, - "url": "https://preview.redd.it/y6q7bgzc1ua51.jpg?width=320&crop=smart&auto=webp&s=3dad39d5e48a1b176f7e87b2dd110fb0044b32d7", - "width": 320, - }, - { - "height": 853, - "url": "https://preview.redd.it/y6q7bgzc1ua51.jpg?width=640&crop=smart&auto=webp&s=2f8e86a3feca27a23a72d10b92aba1b79b80f7be", - "width": 640, - }, - { - "height": 1280, - "url": "https://preview.redd.it/y6q7bgzc1ua51.jpg?width=960&crop=smart&auto=webp&s=5ecdd44b728031f8e109f41f99841a1d6c8e86c8", - "width": 960, - }, - { - "height": 1440, - "url": "https://preview.redd.it/y6q7bgzc1ua51.jpg?width=1080&crop=smart&auto=webp&s=49555499040c0ac9958dabd98cbe4e90c054b2a7", - "width": 1080, - }, - ], - "source": { - "height": 4032, - "url": "https://preview.redd.it/y6q7bgzc1ua51.jpg?auto=webp&s=443e98e46a8a096e426ebdc256c45682f46ebe2a", - "width": 3024, - }, - "variants": {}, - } - ], - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 13614, - "secure_media": None, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": True, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": None, - "thumbnail": "https://b.thumbs.redditmedia.com/RWRuGJ7ZyBtjO6alY1vbc65TQzgng8RFRWnPG7WUkhE.jpg", - "thumbnail_height": 140, - "thumbnail_width": 140, - "title": "The look my dog gives my grandpa", - "top_awarded_type": None, - "total_awards_received": 0, - "treatment_tags": [], - "ups": 13614, - "upvote_ratio": 0.99, - "url": "https://i.redd.it/y6q7bgzc1ua51.jpg", - "url_overridden_by_dest": "https://i.redd.it/y6q7bgzc1ua51.jpg", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - ], - "dist": 25, - "modhash": None, - }, - "kind": "Listing", -} - -external_image_mock = { - "data": { - "after": "t3_hr3mhe", - "before": None, - "children": [ - { - "data": { - "all_awardings": [], - "allow_live_comments": False, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "Captainbuttsreads", - "author_flair_background_color": None, - "author_flair_css_class": None, - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": None, - "author_flair_type": "text", - "author_fullname": "t2_5qaat4af", - "author_patreon_flair": False, - "author_premium": False, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594770844.0, - "created_utc": 1594742044.0, - "crosspost_parent": "t3_gc6eq2", - "crosspost_parent_list": [], - "discussion_type": None, - "distinguished": None, - "domain": "gfycat.com", - "downs": 0, - "edited": False, - "gilded": 0, - "gildings": {}, - "hidden": False, - "hide_score": False, - "id": "hr41am", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": False, - "is_robot_indexable": True, - "is_self": False, - "is_video": False, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": None, - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": False, - "media": None, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hr41am", - "no_follow": False, - "num_comments": 45, - "num_crossposts": 0, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hr41am/excited_cows_have_a_new_brush/", - "pinned": False, - "post_hint": "link", - "preview": { - "enabled": False, - "images": [ - { - "id": "l5tVSe6B4QDc7wk6Z9WfCXr20D_rAOHerf6i0N53nNc", - "resolutions": [ - { - "height": 108, - "url": "https://external-preview.redd.it/R51JAzaGbva91vYxn9uWL3NwCzWJW5mrdVxb1idjtBg.jpg?width=108&crop=smart&auto=webp&s=f908e1fb9403194a31f9a0c1f056f59e0718201e", - "width": 108, - }, - { - "height": 216, - "url": "https://external-preview.redd.it/R51JAzaGbva91vYxn9uWL3NwCzWJW5mrdVxb1idjtBg.jpg?width=216&crop=smart&auto=webp&s=de377df68832a52419d83c06ea74a13de28b96e0", - "width": 216, - }, - ], - "source": { - "height": 250, - "url": "https://external-preview.redd.it/R51JAzaGbva91vYxn9uWL3NwCzWJW5mrdVxb1idjtBg.jpg?auto=webp&s=b4166cb5a350e6d0197381cdf8db702f8a760493", - "width": 250, - }, - "variants": {}, - } - ], - "reddit_video_preview": { - "dash_url": "https://v.redd.it/mimyo7z6ppa51/DASHPlaylist.mpd", - "duration": 33, - "fallback_url": "https://v.redd.it/mimyo7z6ppa51/DASH_480.mp4", - "height": 640, - "hls_url": "https://v.redd.it/mimyo7z6ppa51/HLSPlaylist.m3u8", - "is_gif": True, - "scrubber_media_url": "https://v.redd.it/mimyo7z6ppa51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 640, - }, - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 3219, - "secure_media": None, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": False, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": None, - "thumbnail": "https://b.thumbs.redditmedia.com/NKTwvIU2xxoOMpzYNlYYstS2586x64Gi--52N0M-OJY.jpg", - "thumbnail_height": 140, - "thumbnail_width": 140, - "title": "Excited cows have a new brush!", - "top_awarded_type": None, - "total_awards_received": 0, - "treatment_tags": [], - "ups": 3219, - "upvote_ratio": 0.99, - "url": "http://gfycat.com/thatalivedogwoodclubgall", - "url_overridden_by_dest": "http://gfycat.com/thatalivedogwoodclubgall", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "aww", - "selftext": "", - "author_fullname": "t2_78ni2", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Novosibirsk Zoo welcomes 16 cobalt-eyed Pallas’s cat kittens", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/aww", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "thumbnail_height": 93, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_huoldn", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.99, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 1933, - "total_awards_received": 0, - "media_embed": {}, - "thumbnail_width": 140, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 1933, - "approved_by": None, - "author_premium": False, - "thumbnail": "https://a.thumbs.redditmedia.com/j-D-Z79QQ6tGk0E3SGdb8GzqbLVUY3lu59tDaXbOYl8.jpg", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "post_hint": "image", - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1595292144, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.imgur.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.imgur.com/usfMVUJ.jpg", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": False, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?auto=webp&s=2126d34a0134efa94ecab03917944709c8bc3305", - "width": 1024, - "height": 682, - }, - "resolutions": [ - { - "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=108&crop=smart&auto=webp&s=710a44f787b98a0a37ca543b7428917ee55b3c46", - "width": 108, - "height": 71, - }, - { - "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=216&crop=smart&auto=webp&s=b1bcdd7734a3a569f99fa88c6be9447105e58276", - "width": 216, - "height": 143, - }, - { - "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=320&crop=smart&auto=webp&s=1671bf09a7b73d0ca51cf2de884b37d6a3591d6a", - "width": 320, - "height": 213, - }, - { - "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=640&crop=smart&auto=webp&s=9fcdddbaeaad13273e0b53a862c73c4fee9f7e3d", - "width": 640, - "height": 426, - }, - { - "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=960&crop=smart&auto=webp&s=e531480236c0ae72b78f27dd88f2cedc9f73cccc", - "width": 960, - "height": 639, - }, - ], - "variants": {}, - "id": "oJ9pHVA-JhoodtgNlku8ZQv8FhtadS2r36wGLAriUtY", - } - ], - "enabled": True, - }, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": False, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1o", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "huoldn", - "is_robot_indexable": True, - "report_reasons": None, - "author": "Ben_zyl", - "discussion_type": None, - "num_comments": 20, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/aww/comments/huoldn/novosibirsk_zoo_welcomes_16_cobalteyed_pallass/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.imgur.com/usfMVUJ.jpg", - "subreddit_subscribers": 25723833, - "created_utc": 1595263344, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "dist": 25, - "modhash": None, - }, - "kind": "Listing", -} - -video_mock = { - "data": { - "after": "t3_hr3mhe", - "before": None, - "children": [ - { - "data": { - "all_awardings": [], - "allow_live_comments": False, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "TommyLondoner", - "author_flair_background_color": None, - "author_flair_css_class": None, - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": None, - "author_flair_type": "text", - "author_fullname": "t2_75bis9gi", - "author_patreon_flair": False, - "author_premium": True, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594767660.0, - "created_utc": 1594738860.0, - "discussion_type": None, - "distinguished": None, - "domain": "v.redd.it", - "downs": 0, - "edited": False, - "gilded": 1, - "gildings": {"gid_2": 1}, - "hidden": False, - "hide_score": False, - "id": "hr32jf", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": True, - "is_robot_indexable": True, - "is_self": False, - "is_video": True, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": "lc", - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": False, - "media": { - "reddit_video": { - "dash_url": "https://v.redd.it/9avhmd5s7ua51/DASHPlaylist.mpd?a=1597351258%2CODVjMjcyMDkzOWE1NDBiNzUwNzVhNDUwYmE0MGNiNzk5MGRmZmZmMzBhZjIzNDAzYzczY2NkNzRjNTgyMjAzNQ%3D%3D&v=1&f=sd", - "duration": 78, - "fallback_url": "https://v.redd.it/9avhmd5s7ua51/DASH_360.mp4?source=fallback", - "height": 428, - "hls_url": "https://v.redd.it/9avhmd5s7ua51/HLSPlaylist.m3u8?a=1597351258%2CNjE4YTA0NjUwZWNmNjhjNTRhNmU4ZjBmNDMyYWYxOGYzZTNkZWM2YjViM2I2ZDZjZWNhYzY0ZGVmOWU0Y2EyYg%3D%3D&v=1&f=sd", - "is_gif": False, - "scrubber_media_url": "https://v.redd.it/9avhmd5s7ua51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 258, - } - }, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hr32jf", - "no_follow": False, - "num_comments": 150, - "num_crossposts": 2, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hr32jf/this_guy_definitely_loves_his_job/", - "pinned": False, - "post_hint": "hosted:video", - "preview": { - "enabled": False, - "images": [ - { - "id": "dX_mx_ZfJMwVn_pak9ZPQq8rMT_gPkW0_4gOzDxPSHM", - "resolutions": [ - { - "height": 179, - "url": "https://external-preview.redd.it/PMy-Z___DIG6aWnoyEy1VKottxLQFWCRSdHDV1a9N8w.png?width=108&crop=smart&format=pjpg&auto=webp&s=e0b8b68a78a8e9071bf56417ac6589bc8aff7634", - "width": 108, - }, - { - "height": 358, - "url": "https://external-preview.redd.it/PMy-Z___DIG6aWnoyEy1VKottxLQFWCRSdHDV1a9N8w.png?width=216&crop=smart&format=pjpg&auto=webp&s=8668c3c7ccbdacfe3376d8af4b1b49df9d6aec97", - "width": 216, - }, - ], - "source": { - "height": 428, - "url": "https://external-preview.redd.it/PMy-Z___DIG6aWnoyEy1VKottxLQFWCRSdHDV1a9N8w.png?format=pjpg&auto=webp&s=b0b6439fbe01c3f5d1bf1eae54a588cc745d3415", - "width": 258, - }, - "variants": {}, - } - ], - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 9324, - "secure_media": { - "reddit_video": { - "dash_url": "https://v.redd.it/9avhmd5s7ua51/DASHPlaylist.mpd?a=1597351258%2CODVjMjcyMDkzOWE1NDBiNzUwNzVhNDUwYmE0MGNiNzk5MGRmZmZmMzBhZjIzNDAzYzczY2NkNzRjNTgyMjAzNQ%3D%3D&v=1&f=sd", - "duration": 78, - "fallback_url": "https://v.redd.it/9avhmd5s7ua51/DASH_360.mp4?source=fallback", - "height": 428, - "hls_url": "https://v.redd.it/9avhmd5s7ua51/HLSPlaylist.m3u8?a=1597351258%2CNjE4YTA0NjUwZWNmNjhjNTRhNmU4ZjBmNDMyYWYxOGYzZTNkZWM2YjViM2I2ZDZjZWNhYzY0ZGVmOWU0Y2EyYg%3D%3D&v=1&f=sd", - "is_gif": False, - "scrubber_media_url": "https://v.redd.it/9avhmd5s7ua51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 258, - } - }, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": True, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": None, - "thumbnail": "https://b.thumbs.redditmedia.com/ibsS3H5xMLDSVglh8NBYJ4cgIsXuqYVLJWbiYVTykXg.jpg", - "thumbnail_height": 140, - "thumbnail_width": 140, - "title": "This guy definitely loves his job !", - "top_awarded_type": None, - "total_awards_received": 1, - "treatment_tags": [], - "ups": 9324, - "upvote_ratio": 0.96, - "url": "https://v.redd.it/9avhmd5s7ua51", - "url_overridden_by_dest": "https://v.redd.it/9avhmd5s7ua51", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - { - "data": { - "all_awardings": [], - "allow_live_comments": True, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "LucileEsparza", - "author_flair_background_color": None, - "author_flair_css_class": None, - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": None, - "author_flair_type": "text", - "author_fullname": "t2_5loa1v96", - "author_patreon_flair": False, - "author_premium": False, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594762969.0, - "created_utc": 1594734169.0, - "discussion_type": None, - "distinguished": None, - "domain": "v.redd.it", - "downs": 0, - "edited": False, - "gilded": 0, - "gildings": {}, - "hidden": False, - "hide_score": False, - "id": "hr1r00", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": True, - "is_robot_indexable": True, - "is_self": False, - "is_video": True, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": "lc", - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": False, - "media": { - "reddit_video": { - "dash_url": "https://v.redd.it/eyvbxaeqtta51/DASHPlaylist.mpd?a=1597351258%2CYjJmMWE3ZGJmM2FhMzVkYzZlNjIzOTAwM2ZmZTBkYjAxMzE0NDY2MDIyNGRhOWViMTViZTE0NTlmMzkzM2JlYg%3D%3D&v=1&f=sd", - "duration": 8, - "fallback_url": "https://v.redd.it/eyvbxaeqtta51/DASH_480.mp4?source=fallback", - "height": 640, - "hls_url": "https://v.redd.it/eyvbxaeqtta51/HLSPlaylist.m3u8?a=1597351258%2CY2JiMmQ0MjliNmE5NTA5MDE3YjAyNmVkYTg2Yjg1YWYwYmJlNDE4ZGM1NjE4ZDU3YjkzYjJlMDE2ZmM4Yzk5MQ%3D%3D&v=1&f=sd", - "is_gif": False, - "scrubber_media_url": "https://v.redd.it/eyvbxaeqtta51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 640, - } - }, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hr1r00", - "no_follow": False, - "num_comments": 63, - "num_crossposts": 3, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hr1r00/cool_catt_and_his_clingy_girlfriend/", - "pinned": False, - "post_hint": "hosted:video", - "preview": { - "enabled": False, - "images": [ - { - "id": "wrscJ_l9A6Q_Mn1NAg06I4o3W39bbNgTBYg2Xm_Vl8U", - "resolutions": [ - { - "height": 108, - "url": "https://external-preview.redd.it/GkeXMqmDn03NOYgnIk0QDQAS8HfRacPrmYvyTUSv6w0.png?width=108&crop=smart&format=pjpg&auto=webp&s=f285ef95065be8a340e1cb7792d80a9640564eb6", - "width": 108, - }, - { - "height": 216, - "url": "https://external-preview.redd.it/GkeXMqmDn03NOYgnIk0QDQAS8HfRacPrmYvyTUSv6w0.png?width=216&crop=smart&format=pjpg&auto=webp&s=6d26b4f8d7b16f0f02bc6ce6f35af889b43cf026", - "width": 216, - }, - { - "height": 320, - "url": "https://external-preview.redd.it/GkeXMqmDn03NOYgnIk0QDQAS8HfRacPrmYvyTUSv6w0.png?width=320&crop=smart&format=pjpg&auto=webp&s=5d081467da187bd8c24e9c524583513ee6afe388", - "width": 320, - }, - { - "height": 640, - "url": "https://external-preview.redd.it/GkeXMqmDn03NOYgnIk0QDQAS8HfRacPrmYvyTUSv6w0.png?width=640&crop=smart&format=pjpg&auto=webp&s=557369f302f18b35284ffaacaccf09986f755187", - "width": 640, - }, - ], - "source": { - "height": 640, - "url": "https://external-preview.redd.it/GkeXMqmDn03NOYgnIk0QDQAS8HfRacPrmYvyTUSv6w0.png?format=pjpg&auto=webp&s=cb0a79a2effe0323e862fb713dab76b39051afbb", - "width": 640, - }, - "variants": {}, - } - ], - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 11007, - "secure_media": { - "reddit_video": { - "dash_url": "https://v.redd.it/eyvbxaeqtta51/DASHPlaylist.mpd?a=1597351258%2CYjJmMWE3ZGJmM2FhMzVkYzZlNjIzOTAwM2ZmZTBkYjAxMzE0NDY2MDIyNGRhOWViMTViZTE0NTlmMzkzM2JlYg%3D%3D&v=1&f=sd", - "duration": 8, - "fallback_url": "https://v.redd.it/eyvbxaeqtta51/DASH_480.mp4?source=fallback", - "height": 640, - "hls_url": "https://v.redd.it/eyvbxaeqtta51/HLSPlaylist.m3u8?a=1597351258%2CY2JiMmQ0MjliNmE5NTA5MDE3YjAyNmVkYTg2Yjg1YWYwYmJlNDE4ZGM1NjE4ZDU3YjkzYjJlMDE2ZmM4Yzk5MQ%3D%3D&v=1&f=sd", - "is_gif": False, - "scrubber_media_url": "https://v.redd.it/eyvbxaeqtta51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 640, - } - }, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": False, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": None, - "thumbnail": "https://b.thumbs.redditmedia.com/WSBiDcoWPwAgSkt08uCI6TK7v_tdAdHmQHv7TePyTOs.jpg", - "thumbnail_height": 140, - "thumbnail_width": 140, - "title": "Cool catt and his clingy girlfriend", - "top_awarded_type": None, - "total_awards_received": 1, - "treatment_tags": [], - "ups": 11007, - "upvote_ratio": 0.99, - "url": "https://v.redd.it/eyvbxaeqtta51", - "url_overridden_by_dest": "https://v.redd.it/eyvbxaeqtta51", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - { - "data": { - "all_awardings": [], - "allow_live_comments": False, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "memezzer", - "author_flair_background_color": "", - "author_flair_css_class": "k", - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": "dark", - "author_flair_type": "text", - "author_fullname": "t2_41jaebm4", - "author_patreon_flair": False, - "author_premium": True, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594759625.0, - "created_utc": 1594730825.0, - "discussion_type": None, - "distinguished": None, - "domain": "v.redd.it", - "downs": 0, - "edited": False, - "gilded": 0, - "gildings": {}, - "hidden": False, - "hide_score": False, - "id": "hr0uzh", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": True, - "is_robot_indexable": True, - "is_self": False, - "is_video": True, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": None, - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": False, - "media": { - "reddit_video": { - "dash_url": "https://v.redd.it/y0mavwswjta51/DASHPlaylist.mpd?a=1597351258%2CYjU1NzFjOTE0YzY2OTdmODk3MGRiMGU4MjdhOGE5ODk2YWNiODQyMGUyOWRhNzI1M2U1MTEyZjBhOWZkZTZmMw%3D%3D&v=1&f=sd", - "duration": 8, - "fallback_url": "https://v.redd.it/y0mavwswjta51/DASH_720.mp4?source=fallback", - "height": 960, - "hls_url": "https://v.redd.it/y0mavwswjta51/HLSPlaylist.m3u8?a=1597351258%2CODk4NTdhMzA3NmY2ZmY2NGQxMmI2ZjcyMzk0ZTFhOTdhOGI4NGQ1NjBiMzNiMmVmZDBhMTQ4MGRkOWJlOWU1YQ%3D%3D&v=1&f=sd", - "is_gif": False, - "scrubber_media_url": "https://v.redd.it/y0mavwswjta51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 960, - } - }, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hr0uzh", - "no_follow": False, - "num_comments": 86, - "num_crossposts": 3, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hr0uzh/good_pillow/", - "pinned": False, - "post_hint": "hosted:video", - "preview": { - "enabled": False, - "images": [ - { - "id": "neoTdGv5lMArlfu6euGUK_v_O87Lfmdrrz1ePTwzp1w", - "resolutions": [ - { - "height": 108, - "url": "https://external-preview.redd.it/E3alyJV8xErhjjDt_Qujcd0ZqmUhGOSFINXALm2FZAQ.png?width=108&crop=smart&format=pjpg&auto=webp&s=dcc1172b7ace007e8c72080519a16a487596d7e2", - "width": 108, - }, - { - "height": 216, - "url": "https://external-preview.redd.it/E3alyJV8xErhjjDt_Qujcd0ZqmUhGOSFINXALm2FZAQ.png?width=216&crop=smart&format=pjpg&auto=webp&s=a7968ce1aa34957a7f7103d06a66d4f9df95d437", - "width": 216, - }, - { - "height": 320, - "url": "https://external-preview.redd.it/E3alyJV8xErhjjDt_Qujcd0ZqmUhGOSFINXALm2FZAQ.png?width=320&crop=smart&format=pjpg&auto=webp&s=a2302d80948fba08e91db0a10db579341e1df712", - "width": 320, - }, - { - "height": 640, - "url": "https://external-preview.redd.it/E3alyJV8xErhjjDt_Qujcd0ZqmUhGOSFINXALm2FZAQ.png?width=640&crop=smart&format=pjpg&auto=webp&s=a8487450d38d14bcdfda2aeb659b453d8b1cacab", - "width": 640, - }, - { - "height": 960, - "url": "https://external-preview.redd.it/E3alyJV8xErhjjDt_Qujcd0ZqmUhGOSFINXALm2FZAQ.png?width=960&crop=smart&format=pjpg&auto=webp&s=d371bee68cab49130babe4b890c6323db128c214", - "width": 960, - }, - ], - "source": { - "height": 960, - "url": "https://external-preview.redd.it/E3alyJV8xErhjjDt_Qujcd0ZqmUhGOSFINXALm2FZAQ.png?format=pjpg&auto=webp&s=ff90de8f0a693afeca69dc85dbecb6af9783c769", - "width": 960, - }, - "variants": {}, - } - ], - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 13271, - "secure_media": { - "reddit_video": { - "dash_url": "https://v.redd.it/y0mavwswjta51/DASHPlaylist.mpd?a=1597351258%2CYjU1NzFjOTE0YzY2OTdmODk3MGRiMGU4MjdhOGE5ODk2YWNiODQyMGUyOWRhNzI1M2U1MTEyZjBhOWZkZTZmMw%3D%3D&v=1&f=sd", - "duration": 8, - "fallback_url": "https://v.redd.it/y0mavwswjta51/DASH_720.mp4?source=fallback", - "height": 960, - "hls_url": "https://v.redd.it/y0mavwswjta51/HLSPlaylist.m3u8?a=1597351258%2CODk4NTdhMzA3NmY2ZmY2NGQxMmI2ZjcyMzk0ZTFhOTdhOGI4NGQ1NjBiMzNiMmVmZDBhMTQ4MGRkOWJlOWU1YQ%3D%3D&v=1&f=sd", - "is_gif": False, - "scrubber_media_url": "https://v.redd.it/y0mavwswjta51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 960, - } - }, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": True, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": "confidence", - "thumbnail": "https://b.thumbs.redditmedia.com/sxFESWCVsSf4ij5_-a1xdJaFhSU2MjJ5T_TVFbook6Q.jpg", - "thumbnail_height": 140, - "thumbnail_width": 140, - "title": "Good pillow", - "top_awarded_type": None, - "total_awards_received": 0, - "treatment_tags": [], - "ups": 13271, - "upvote_ratio": 0.99, - "url": "https://v.redd.it/y0mavwswjta51", - "url_overridden_by_dest": "https://v.redd.it/y0mavwswjta51", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - { - "data": { - "all_awardings": [], - "allow_live_comments": True, - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "asdfpartyy", - "author_flair_background_color": None, - "author_flair_css_class": None, - "author_flair_richtext": [], - "author_flair_template_id": None, - "author_flair_text": None, - "author_flair_text_color": None, - "author_flair_type": "text", - "author_fullname": "t2_t0ay0", - "author_patreon_flair": False, - "author_premium": True, - "awarders": [], - "banned_at_utc": None, - "banned_by": None, - "can_gild": True, - "can_mod_post": False, - "category": None, - "clicked": False, - "content_categories": None, - "contest_mode": False, - "created": 1594745472.0, - "created_utc": 1594716672.0, - "discussion_type": None, - "distinguished": None, - "domain": "v.redd.it", - "downs": 0, - "edited": False, - "gilded": 1, - "gildings": {"gid_2": 1}, - "hidden": False, - "hide_score": False, - "id": "hqy0ny", - "is_crosspostable": True, - "is_meta": False, - "is_original_content": False, - "is_reddit_media_domain": True, - "is_robot_indexable": True, - "is_self": False, - "is_video": True, - "likes": None, - "link_flair_background_color": "", - "link_flair_css_class": None, - "link_flair_richtext": [], - "link_flair_text": None, - "link_flair_text_color": "dark", - "link_flair_type": "text", - "locked": False, - "media": { - "reddit_video": { - "dash_url": "https://v.redd.it/asj4p03rdsa51/DASHPlaylist.mpd?a=1597351258%2CY2VmYTAyMWNmZjIwZjQ4YTBmMDc5MTRjOTU0NjliZWU3MDE2YTU3NjJiYzQxZWRiODY4ZTc1YWI1NDY4MWIxNA%3D%3D&v=1&f=sd", - "duration": 30, - "fallback_url": "https://v.redd.it/asj4p03rdsa51/DASH_360.mp4?source=fallback", - "height": 360, - "hls_url": "https://v.redd.it/asj4p03rdsa51/HLSPlaylist.m3u8?a=1597351258%2CY2QxM2I4Njk5MmIyOTRiZTBhNDQ2MDg0ZTM2NTllYzBjODBlYjNiNDc1Mzg2ODIxNDk4MTAzMzYyNzlmNjI1NQ%3D%3D&v=1&f=sd", - "is_gif": False, - "scrubber_media_url": "https://v.redd.it/asj4p03rdsa51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 640, - } - }, - "media_embed": {}, - "media_only": False, - "mod_note": None, - "mod_reason_by": None, - "mod_reason_title": None, - "mod_reports": [], - "name": "t3_hqy0ny", - "no_follow": False, - "num_comments": 849, - "num_crossposts": 24, - "num_reports": None, - "over_18": False, - "parent_whitelist_status": "all_ads", - "permalink": "/r/aww/comments/hqy0ny/bunnies_flop_over_when_they_feel_completely_safe/", - "pinned": False, - "post_hint": "hosted:video", - "preview": { - "enabled": False, - "images": [ - { - "id": "eMi5JzdWDMeDALsqK8bVceX3jbXTWS_S1D-Ie1hQxnc", - "resolutions": [ - { - "height": 60, - "url": "https://external-preview.redd.it/e67OvQTnkypoYCuC4ApCsgdzVGjPLX3986XW_Ttm9bU.png?width=108&crop=smart&format=pjpg&auto=webp&s=5c6d61e0d4934df3c1f4b7a4c3c3afdd4c31c037", - "width": 108, - }, - { - "height": 121, - "url": "https://external-preview.redd.it/e67OvQTnkypoYCuC4ApCsgdzVGjPLX3986XW_Ttm9bU.png?width=216&crop=smart&format=pjpg&auto=webp&s=24586000b5821e23ce78f395c1f294bbe3fa3945", - "width": 216, - }, - { - "height": 180, - "url": "https://external-preview.redd.it/e67OvQTnkypoYCuC4ApCsgdzVGjPLX3986XW_Ttm9bU.png?width=320&crop=smart&format=pjpg&auto=webp&s=dcaed0109703cbddd4914e138afdb61086cffd81", - "width": 320, - }, - { - "height": 360, - "url": "https://external-preview.redd.it/e67OvQTnkypoYCuC4ApCsgdzVGjPLX3986XW_Ttm9bU.png?width=640&crop=smart&format=pjpg&auto=webp&s=ef4f6dc33fe582b93e954114e9eb1447bbbc197b", - "width": 640, - }, - ], - "source": { - "height": 360, - "url": "https://external-preview.redd.it/e67OvQTnkypoYCuC4ApCsgdzVGjPLX3986XW_Ttm9bU.png?format=pjpg&auto=webp&s=b6e8cba9d25c684ecb7104c1e1c454dba7fd3f2f", - "width": 640, - }, - "variants": {}, - } - ], - }, - "pwls": 6, - "quarantine": False, - "removal_reason": None, - "removed_by": None, - "removed_by_category": None, - "report_reasons": None, - "saved": False, - "score": 112661, - "secure_media": { - "reddit_video": { - "dash_url": "https://v.redd.it/asj4p03rdsa51/DASHPlaylist.mpd?a=1597351258%2CY2VmYTAyMWNmZjIwZjQ4YTBmMDc5MTRjOTU0NjliZWU3MDE2YTU3NjJiYzQxZWRiODY4ZTc1YWI1NDY4MWIxNA%3D%3D&v=1&f=sd", - "duration": 30, - "fallback_url": "https://v.redd.it/asj4p03rdsa51/DASH_360.mp4?source=fallback", - "height": 360, - "hls_url": "https://v.redd.it/asj4p03rdsa51/HLSPlaylist.m3u8?a=1597351258%2CY2QxM2I4Njk5MmIyOTRiZTBhNDQ2MDg0ZTM2NTllYzBjODBlYjNiNDc1Mzg2ODIxNDk4MTAzMzYyNzlmNjI1NQ%3D%3D&v=1&f=sd", - "is_gif": False, - "scrubber_media_url": "https://v.redd.it/asj4p03rdsa51/DASH_96.mp4", - "transcoding_status": "completed", - "width": 640, - } - }, - "secure_media_embed": {}, - "selftext": "", - "selftext_html": None, - "send_replies": True, - "spoiler": False, - "stickied": False, - "subreddit": "aww", - "subreddit_id": "t5_2qh1o", - "subreddit_name_prefixed": "r/aww", - "subreddit_subscribers": 25634399, - "subreddit_type": "public", - "suggested_sort": None, - "thumbnail": "https://b.thumbs.redditmedia.com/l_4Yk7NC8hz2HM0D3Hv2dK_nZBjpL8FL3NPv9WkRo8k.jpg", - "thumbnail_height": 78, - "thumbnail_width": 140, - "title": "Bunnies flop over when they feel " - "completely safe beside their " - "protectors", - "top_awarded_type": None, - "total_awards_received": 12, - "treatment_tags": [], - "ups": 112661, - "upvote_ratio": 0.94, - "url": "https://v.redd.it/asj4p03rdsa51", - "url_overridden_by_dest": "https://v.redd.it/asj4p03rdsa51", - "user_reports": [], - "view_count": None, - "visited": False, - "whitelist_status": "all_ads", - "wls": 6, - }, - "kind": "t3", - }, - ], - "dist": 25, - "modhash": None, - }, - "kind": "Listing", -} - -external_video_mock = { - "data": { - "after": "t3_hr3mhe", - "before": None, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "aww", - "selftext": "", - "author_fullname": "t2_ot2b2", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Dog splashing in water", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/aww", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "thumbnail_height": 140, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hulh8k", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.94, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 1142, - "total_awards_received": 0, - "media_embed": { - "content": '<iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fexcellentinfantileamericanwigeon&display_name=Gfycat&url=https%3A%2F%2Fgfycat.com%2Fexcellentinfantileamericanwigeon&image=https%3A%2F%2Fthumbs.gfycat.com%2FExcellentInfantileAmericanwigeon-size_restricted.gif&key=ed8fa8699ce04833838e66ce79ba05f1&type=text%2Fhtml&schema=gfycat" width="400" height="400" scrolling="no" title="Gfycat embed" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="True"></iframe>', - "width": 400, - "scrolling": False, - "height": 400, - }, - "thumbnail_width": 140, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": { - "oembed": { - "provider_url": "https://gfycat.com", - "description": 'Hi! We use cookies and similar technologies ("cookies"), including third-party cookies, on this website to help operate and improve your experience on our site, monitor our site performance, and for advertising purposes. By clicking "Accept Cookies" below, you are giving us consent to use cookies (except consent is not required for cookies necessary to run our site).', - "title": "97991217 286625482366728 7551185146460766208 n", - "author_name": "Gfycat", - "height": 400, - "width": 400, - "html": '<iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fexcellentinfantileamericanwigeon&display_name=Gfycat&url=https%3A%2F%2Fgfycat.com%2Fexcellentinfantileamericanwigeon&image=https%3A%2F%2Fthumbs.gfycat.com%2FExcellentInfantileAmericanwigeon-size_restricted.gif&key=ed8fa8699ce04833838e66ce79ba05f1&type=text%2Fhtml&schema=gfycat" width="400" height="400" scrolling="no" title="Gfycat embed" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="True"></iframe>', - "thumbnail_width": 250, - "version": "1.0", - "provider_name": "Gfycat", - "thumbnail_url": "https://thumbs.gfycat.com/ExcellentInfantileAmericanwigeon-size_restricted.gif", - "type": "video", - "thumbnail_height": 250, - }, - "type": "gfycat.com", - }, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": { - "content": '<iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fexcellentinfantileamericanwigeon&display_name=Gfycat&url=https%3A%2F%2Fgfycat.com%2Fexcellentinfantileamericanwigeon&image=https%3A%2F%2Fthumbs.gfycat.com%2FExcellentInfantileAmericanwigeon-size_restricted.gif&key=ed8fa8699ce04833838e66ce79ba05f1&type=text%2Fhtml&schema=gfycat" width="400" height="400" scrolling="no" title="Gfycat embed" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="True"></iframe>', - "width": 400, - "scrolling": False, - "media_domain_url": "https://www.redditmedia.com/mediaembed/hulh8k", - "height": 400, - }, - "link_flair_text": None, - "can_mod_post": False, - "score": 1142, - "approved_by": None, - "author_premium": False, - "thumbnail": "https://b.thumbs.redditmedia.com/eR_Cu4w1l9PwaM14RTEpnKD20EaK5mMxUbyK8BBDo_M.jpg", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "post_hint": "rich:video", - "content_categories": None, - "is_self": False, - "mod_note": None, - "crosspost_parent_list": [], - "created": 1595281442, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "gfycat.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://gfycat.com/excellentinfantileamericanwigeon", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://external-preview.redd.it/rZXN_aGbww8NNlhGWB-5cjHPonSST4S7aS6uaZyb_W4.jpg?auto=webp&s=2a2d3a1e0a06742bf752c1c4e1582c2fa49793a3", - "width": 250, - "height": 250, - }, - "resolutions": [ - { - "url": "https://external-preview.redd.it/rZXN_aGbww8NNlhGWB-5cjHPonSST4S7aS6uaZyb_W4.jpg?width=108&crop=smart&auto=webp&s=35f61b003416516f664682717876a94d186793ae", - "width": 108, - "height": 108, - }, - { - "url": "https://external-preview.redd.it/rZXN_aGbww8NNlhGWB-5cjHPonSST4S7aS6uaZyb_W4.jpg?width=216&crop=smart&auto=webp&s=842416c1b8f8fae758a7ba6eb98af93ee2404a8d", - "width": 216, - "height": 216, - }, - ], - "variants": {}, - "id": "IVorc9dV9K9nJhhSVFKST92dfGfmhgBQjw257DWmJcE", - } - ], - "reddit_video_preview": { - "fallback_url": "https://v.redd.it/syp9pkiu00c51/DASH_360.mp4", - "height": 400, - "width": 400, - "scrubber_media_url": "https://v.redd.it/syp9pkiu00c51/DASH_96.mp4", - "dash_url": "https://v.redd.it/syp9pkiu00c51/DASHPlaylist.mpd", - "duration": 21, - "hls_url": "https://v.redd.it/syp9pkiu00c51/HLSPlaylist.m3u8", - "is_gif": True, - "transcoding_status": "completed", - }, - "enabled": False, - }, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1o", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hulh8k", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheRikari", - "discussion_type": None, - "num_comments": 21, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_hujqxu", - "author_flair_text_color": None, - "permalink": "/r/aww/comments/hulh8k/dog_splashing_in_water/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://gfycat.com/excellentinfantileamericanwigeon", - "subreddit_subscribers": 25721914, - "created_utc": 1595252642, - "num_crossposts": 0, - "media": { - "oembed": { - "provider_url": "https://gfycat.com", - "description": 'Hi! We use cookies and similar technologies ("cookies"), including third-party cookies, on this website to help operate and improve your experience on our site, monitor our site performance, and for advertising purposes. By clicking "Accept Cookies" below, you are giving us consent to use cookies (except consent is not required for cookies necessary to run our site).', - "title": "97991217 286625482366728 7551185146460766208 n", - "author_name": "Gfycat", - "height": 400, - "width": 400, - "html": '<iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fexcellentinfantileamericanwigeon&display_name=Gfycat&url=https%3A%2F%2Fgfycat.com%2Fexcellentinfantileamericanwigeon&image=https%3A%2F%2Fthumbs.gfycat.com%2FExcellentInfantileAmericanwigeon-size_restricted.gif&key=ed8fa8699ce04833838e66ce79ba05f1&type=text%2Fhtml&schema=gfycat" width="400" height="400" scrolling="no" title="Gfycat embed" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="True"></iframe>', - "thumbnail_width": 250, - "version": "1.0", - "provider_name": "Gfycat", - "thumbnail_url": "https://thumbs.gfycat.com/ExcellentInfantileAmericanwigeon-size_restricted.gif", - "type": "video", - "thumbnail_height": 250, - }, - "type": "gfycat.com", - }, - "is_video": False, - }, - } - ], - "dist": 25, - "modhash": None, - }, - "kind": "Listing", -} - -external_gifv_mock = { - "data": { - "after": "t3_hr3mhe", - "before": None, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "aww", - "selftext": "", - "author_fullname": "t2_ygx0p1u", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "if i fits i sits", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/aww", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "thumbnail_height": 74, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_humdlf", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.97, - "author_flair_background_color": "", - "subreddit_type": "public", - "ups": 7512, - "total_awards_received": 1, - "media_embed": {}, - "thumbnail_width": 140, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 7512, - "approved_by": None, - "author_premium": True, - "thumbnail": "https://b.thumbs.redditmedia.com/QHK44nUFZup-hfFX2Z1dXhk-1lPEmROUCB3bBujvTck.jpg", - "edited": False, - "author_flair_css_class": "k", - "author_flair_richtext": [], - "gildings": {}, - "post_hint": "link", - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1595284712, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.imgur.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": "confidence", - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.imgur.com/grVh2AG.gifv", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": False, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?auto=webp&s=c4ba246318b3502b080d37fcbdb12e07221401a9", - "width": 638, - "height": 338, - }, - "resolutions": [ - { - "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=108&crop=smart&auto=webp&s=c9c340a60ba3da1af3f5d5c08f3ed618ebd567d4", - "width": 108, - "height": 57, - }, - { - "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=216&crop=smart&auto=webp&s=d05c0415e3dc63d097264bfb1b35b09676bd24f6", - "width": 216, - "height": 114, - }, - { - "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=320&crop=smart&auto=webp&s=5c236179ccfff29e9ba980f31d5a6a9905adbe86", - "width": 320, - "height": 169, - }, - ], - "variants": {}, - "id": "4Z8zF5e4sZJnX4vWH7pZkbqiDPMCuh2J4kNotV9AGSI", - } - ], - "reddit_video_preview": { - "fallback_url": "https://v.redd.it/zzctc8y2dzb51/DASH_240.mp4", - "height": 338, - "width": 638, - "scrubber_media_url": "https://v.redd.it/zzctc8y2dzb51/DASH_96.mp4", - "dash_url": "https://v.redd.it/zzctc8y2dzb51/DASHPlaylist.mpd", - "duration": 44, - "hls_url": "https://v.redd.it/zzctc8y2dzb51/HLSPlaylist.m3u8", - "is_gif": True, - "transcoding_status": "completed", - }, - "enabled": False, - }, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": False, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1o", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "humdlf", - "is_robot_indexable": True, - "report_reasons": None, - "author": "jasontaken", - "discussion_type": None, - "num_comments": 67, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/aww/comments/humdlf/if_i_fits_i_sits/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.imgur.com/grVh2AG.gifv", - "subreddit_subscribers": 25723833, - "created_utc": 1595255912, - "num_crossposts": 1, - "media": None, - "is_video": False, - }, - } - ], - "dist": 25, - "modhash": None, - }, - "kind": "Listing", -} - -unknown_mock = { - "data": { - "after": "t3_hr3mhe", - "before": None, - "children": [ - { - "kind": "t1", - "data": { - "approved_at_utc": None, - "subreddit": "aww", - "selftext": "", - "author_fullname": "t2_ygx0p1u", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "if i fits i sits", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/aww", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "thumbnail_height": 74, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_humdlf", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.97, - "author_flair_background_color": "", - "subreddit_type": "public", - "ups": 7512, - "total_awards_received": 1, - "media_embed": {}, - "thumbnail_width": 140, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 7512, - "approved_by": None, - "author_premium": True, - "thumbnail": "https://b.thumbs.redditmedia.com/QHK44nUFZup-hfFX2Z1dXhk-1lPEmROUCB3bBujvTck.jpg", - "edited": False, - "author_flair_css_class": "k", - "author_flair_richtext": [], - "gildings": {}, - "post_hint": "link", - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1595284712, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.imgur.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": "confidence", - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.imgur.com/grVh2AG.gifv", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": False, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?auto=webp&s=c4ba246318b3502b080d37fcbdb12e07221401a9", - "width": 638, - "height": 338, - }, - "resolutions": [ - { - "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=108&crop=smart&auto=webp&s=c9c340a60ba3da1af3f5d5c08f3ed618ebd567d4", - "width": 108, - "height": 57, - }, - { - "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=216&crop=smart&auto=webp&s=d05c0415e3dc63d097264bfb1b35b09676bd24f6", - "width": 216, - "height": 114, - }, - { - "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=320&crop=smart&auto=webp&s=5c236179ccfff29e9ba980f31d5a6a9905adbe86", - "width": 320, - "height": 169, - }, - ], - "variants": {}, - "id": "4Z8zF5e4sZJnX4vWH7pZkbqiDPMCuh2J4kNotV9AGSI", - } - ], - "reddit_video_preview": { - "fallback_url": "https://v.redd.it/zzctc8y2dzb51/DASH_240.mp4", - "height": 338, - "width": 638, - "scrubber_media_url": "https://v.redd.it/zzctc8y2dzb51/DASH_96.mp4", - "dash_url": "https://v.redd.it/zzctc8y2dzb51/DASHPlaylist.mpd", - "duration": 44, - "hls_url": "https://v.redd.it/zzctc8y2dzb51/HLSPlaylist.m3u8", - "is_gif": True, - "transcoding_status": "completed", - }, - "enabled": False, - }, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": False, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1o", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "humdlf", - "is_robot_indexable": True, - "report_reasons": None, - "author": "jasontaken", - "discussion_type": None, - "num_comments": 67, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/aww/comments/humdlf/if_i_fits_i_sits/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.imgur.com/grVh2AG.gifv", - "subreddit_subscribers": 25723833, - "created_utc": 1595255912, - "num_crossposts": 1, - "media": None, - "is_video": False, - }, - } - ], - "dist": 25, - "modhash": None, - }, - "kind": "Listing", -} - -nsfw_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 8, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": True, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 9, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 2, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 2, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 544037, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmytic", - "before": None, - }, -} - -spoiler_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 8, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 9, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 2, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": True, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 2, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 544037, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmytic", - "before": None, - }, -} - -seen_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": True, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 8, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 9, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 2, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 2, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 544037, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmytic", - "before": None, - }, -} - -upvote_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": True, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 99, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 9, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 150, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 2, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 544037, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmytic", - "before": None, - }, -} - -comment_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": True, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 99, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 150, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 150, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 80, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 544037, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmytic", - "before": None, - }, -} - -downvote_mock = { - "kind": "Listing", - "data": { - "modhash": "rjewztai5w0ab64547311ae1fb1f9cf81cd18949bfb629cb7f", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": True, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 10, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.7, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 99, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": "<!-- SC_OFF --><div class='md'><p>Welcome to <a href='/r/linux'>r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href='/r/linux'>r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href='/r/linuxadmin'>r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href='/r/linuxquestions'>r/linuxquestions</a>, <a href='/r/linux4noobs'>r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->", - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 150, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 544037, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 40, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 150, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 80, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 544037, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmytic", - "before": None, - }, -} diff --git a/src/newsreader/news/collection/tests/reddit/builder/tests.py b/src/newsreader/news/collection/tests/reddit/builder/tests.py deleted file mode 100644 index 5144edf..0000000 --- a/src/newsreader/news/collection/tests/reddit/builder/tests.py +++ /dev/null @@ -1,472 +0,0 @@ -from datetime import datetime, timezone -from unittest.mock import Mock - -from django.test import TestCase - -from newsreader.news.collection.reddit import RedditBuilder -from newsreader.news.collection.tests.factories import SubredditFactory -from newsreader.news.collection.tests.reddit.builder.mocks import ( - author_mock, - comment_mock, - downvote_mock, - duplicate_mock, - empty_mock, - external_gifv_mock, - external_image_mock, - external_video_mock, - image_mock, - nsfw_mock, - seen_mock, - simple_mock, - spoiler_mock, - title_mock, - unknown_mock, - unsanitized_mock, - upvote_mock, - video_mock, -) -from newsreader.news.core.models import Post -from newsreader.news.core.tests.factories import RedditPostFactory - - -class RedditBuilderTestCase(TestCase): - def setUp(self): - self.maxDiff = None - - def test_simple_mock(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(simple_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertCountEqual( - ("hm0qct", "hna75r", "hngs71", "hngsj8", "hnd7cy"), posts.keys() - ) - - post = posts["hm0qct"] - - self.assertEqual(post.rule, subreddit) - self.assertEqual( - post.title, - "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - ) - self.assertIn( - " This megathread is also to hear opinions from anyone just starting out" - " with Linux or those that have used Linux (GNU or otherwise) for a long", - post.body, - ) - - self.assertIn( - "

For those looking for certifications please use this megathread to ask about how" - " to get certified whether it's for the business world or for your own satisfaction." - ' Be sure to check out r/linuxadmin for more discussion in the' - " SysAdmin world!

", - post.body, - ) - - self.assertEqual(post.author, "AutoModerator") - self.assertEqual( - post.url, - "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - ) - self.assertEqual( - post.publication_date, datetime(2020, 7, 6, 6, 11, 22, tzinfo=timezone.utc) - ) - - def test_empty_data(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(empty_mock, mock_stream) as builder: - builder.build() - builder.save() - - self.assertEqual(Post.objects.count(), 0) - - def test_unknown_mock(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(unknown_mock, mock_stream) as builder: - builder.build() - builder.save() - - self.assertEqual(Post.objects.count(), 0) - - def test_html_sanitizing(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(unsanitized_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertCountEqual(("hnd7cy",), posts.keys()) - - post = posts["hnd7cy"] - - self.assertEqual(post.body, "
") - - def test_long_author_text_is_truncated(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(author_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertCountEqual(("hnd7cy",), posts.keys()) - - post = posts["hnd7cy"] - - self.assertEqual(post.author, "TheQuantumZeroTheQuantumZeroTheQuantumZ…") - - def test_long_title_text_is_truncated(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(title_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertCountEqual(("hnd7cy",), posts.keys()) - - post = posts["hnd7cy"] - - self.assertEqual( - post.title, - 'Board statement on the LibreOffice 7.0 RC "Personal EditionBoard statement on the LibreOffice 7.0 RC "Personal Edition" label" labelBoard statement on the LibreOffice 7.0 RC "PersBoard statement on t…', - ) - - def test_duplicate_in_response(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(duplicate_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertEqual(Post.objects.count(), 2) - self.assertCountEqual(("hm0qct", "hna75r"), posts.keys()) - - def test_duplicate_in_database(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - RedditPostFactory(remote_identifier="hm0qct", rule=subreddit, title="foo") - - with builder(simple_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertEqual(Post.objects.count(), 5) - self.assertCountEqual( - ("hm0qct", "hna75r", "hngs71", "hngsj8", "hnd7cy"), posts.keys() - ) - - def test_image_post(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(image_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertCountEqual(("hr64xh", "hr4bxo", "hr14y5", "hr2fv0"), posts.keys()) - - post = posts["hr64xh"] - - title = ( - "Ya’ll, I just can’t... this is my " - "son, Judah. My wife and I have no " - "idea how we created such a " - "beautiful child." - ) - url = "https://i.redd.it/cm2qybia1va51.jpg" - - self.assertEqual( - "https://www.reddit.com/r/aww/comments/hr64xh/yall_i_just_cant_this_is_my_son_judah_my_wife_and/", - post.url, - ) - self.assertEqual( - f"
{title}
", post.body - ) - - def test_external_image_post(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(external_image_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertCountEqual(("hr41am", "huoldn"), posts.keys()) - - post = posts["hr41am"] - - url = "http://gfycat.com/thatalivedogwoodclubgall" - title = "Excited cows have a new brush!" - - self.assertEqual( - f"", - post.body, - ) - self.assertEqual( - "https://www.reddit.com/r/aww/comments/hr41am/excited_cows_have_a_new_brush/", - post.url, - ) - - post = posts["huoldn"] - - url = "https://i.imgur.com/usfMVUJ.jpg" - title = "Novosibirsk Zoo welcomes 16 cobalt-eyed Pallas’s cat kittens" - - self.assertEqual( - f"
{title}
", post.body - ) - self.assertEqual( - "https://www.reddit.com/r/aww/comments/huoldn/novosibirsk_zoo_welcomes_16_cobalteyed_pallass/", - post.url, - ) - - def test_video_post(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(video_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertCountEqual(("hr32jf", "hr1r00", "hqy0ny", "hr0uzh"), posts.keys()) - - post = posts["hr1r00"] - - url = "https://v.redd.it/eyvbxaeqtta51/DASH_480.mp4?source=fallback" - - self.assertEqual( - post.url, - "https://www.reddit.com/r/aww/comments/hr1r00/cool_catt_and_his_clingy_girlfriend/", - ) - self.assertEqual( - f"
", - post.body, - ) - - def test_external_video_post(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(external_video_mock, mock_stream) as builder: - builder.build() - builder.save() - - post = Post.objects.get() - - self.assertEqual(post.remote_identifier, "hulh8k") - - self.assertEqual( - post.url, - "https://www.reddit.com/r/aww/comments/hulh8k/dog_splashing_in_water/", - ) - - title = "Dog splashing in water" - url = "https://gfycat.com/excellentinfantileamericanwigeon" - - self.assertEqual( - f"", - post.body, - ) - - def test_external_gifv_video_post(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(external_gifv_mock, mock_stream) as builder: - builder.build() - builder.save() - - post = Post.objects.get() - - self.assertEqual(post.remote_identifier, "humdlf") - - self.assertEqual( - post.url, "https://www.reddit.com/r/aww/comments/humdlf/if_i_fits_i_sits/" - ) - - self.assertEqual( - "
", - post.body, - ) - - def test_link_only_post(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(simple_mock, mock_stream) as builder: - builder.build() - builder.save() - - post = Post.objects.get(remote_identifier="hngsj8") - - title = "KeePassXC 2.6.0 released" - url = "https://keepassxc.org/blog/2020-07-07-2.6.0-released/" - - self.assertIn( - f"", - post.body, - ) - - self.assertEqual( - post.url, - "https://www.reddit.com/r/linux/comments/hngsj8/keepassxc_260_released/", - ) - - def test_skip_not_known_post_type(self): - builder = RedditBuilder - - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - with builder(unknown_mock, mock_stream) as builder: - builder.build() - builder.save() - - self.assertEqual(Post.objects.count(), 0) - - def test_nsfw_not_allowed(self): - builder = RedditBuilder - - subreddit = SubredditFactory(reddit_allow_nfsw=False) - mock_stream = Mock(rule=subreddit) - - with builder(nsfw_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertEqual(Post.objects.count(), 1) - self.assertCountEqual(("hna75r",), posts.keys()) - - def test_spoiler_not_allowed(self): - builder = RedditBuilder - - subreddit = SubredditFactory(reddit_allow_spoiler=False) - mock_stream = Mock(rule=subreddit) - - with builder(spoiler_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertEqual(Post.objects.count(), 1) - self.assertCountEqual(("hm0qct",), posts.keys()) - - def test_already_seen_not_allowed(self): - builder = RedditBuilder - - subreddit = SubredditFactory(reddit_allow_viewed=False) - mock_stream = Mock(rule=subreddit) - - with builder(seen_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertEqual(Post.objects.count(), 1) - self.assertCountEqual(("hna75r",), posts.keys()) - - def test_upvote_minimum(self): - builder = RedditBuilder - - subreddit = SubredditFactory(reddit_upvotes_min=100) - mock_stream = Mock(rule=subreddit) - - with builder(upvote_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertEqual(Post.objects.count(), 1) - self.assertCountEqual(("hna75r",), posts.keys()) - - def test_comments_minimum(self): - builder = RedditBuilder - - subreddit = SubredditFactory(reddit_comments_min=100) - mock_stream = Mock(rule=subreddit) - - with builder(comment_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertEqual(Post.objects.count(), 1) - self.assertCountEqual(("hm0qct",), posts.keys()) - - def test_downvote_maximum(self): - builder = RedditBuilder - - subreddit = SubredditFactory(reddit_downvotes_max=20) - mock_stream = Mock(rule=subreddit) - - with builder(downvote_mock, mock_stream) as builder: - builder.build() - builder.save() - - posts = {post.remote_identifier: post for post in Post.objects.all()} - - self.assertEqual(Post.objects.count(), 1) - self.assertCountEqual(("hm0qct",), posts.keys()) diff --git a/src/newsreader/news/collection/tests/reddit/client/__init__.py b/src/newsreader/news/collection/tests/reddit/client/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/newsreader/news/collection/tests/reddit/client/mocks.py b/src/newsreader/news/collection/tests/reddit/client/mocks.py deleted file mode 100644 index 6a11409..0000000 --- a/src/newsreader/news/collection/tests/reddit/client/mocks.py +++ /dev/null @@ -1,160 +0,0 @@ -# Note that some response data is truncated - -simple_mock = { - "data": { - "after": "t3_hjywyf", - "before": None, - "children": [ - { - "data": { - "approved_at_utc": None, - "approved_by": None, - "archived": False, - "author": "AutoModerator", - "banned_at_utc": None, - "banned_by": None, - "category": None, - "content_categories": None, - "created": 1593605471.0, - "created_utc": 1593576671.0, - "discussion_type": None, - "distinguished": "moderator", - "domain": "self.linux", - "edited": False, - "hidden": False, - "id": "hj34ck", - "locked": False, - "name": "t3_hj34ck", - "permalink": "/r/linux/comments/hj34ck/weekly_questions_and_hardware_thread_july_01_2020/", - "pinned": False, - "selftext": "Welcome to r/linux! If you're " - "new to Linux or trying to get " - "started this thread is for you. " - "Get help here or as always, " - "check out r/linuxquestions or " - "r/linux4noobs\n" - "\n" - "This megathread is for all your " - "question needs. As we don't " - "allow questions on r/linux " - "outside of this megathread, " - "please consider using " - "r/linuxquestions or " - "r/linux4noobs for the best " - "solution to your problem.\n" - "\n" - "Ask your hardware requests here " - "too or try r/linuxhardware!", - "selftext_html": "<!-- SC_OFF " - "--><div " - 'class="md"><p>Welcome ' - "to <a " - 'href="/r/linux">r/linux</a>! ' - "If you&#39;re new to " - "Linux or trying to get " - "started this thread is for " - "you. Get help here or as " - "always, check out <a " - 'href="/r/linuxquestions">r/linuxquestions</a> ' - "or <a " - 'href="/r/linux4noobs">r/linux4noobs</a></p>\n' - "\n" - "<p>This megathread is " - "for all your question " - "needs. As we don&#39;t " - "allow questions on <a " - 'href="/r/linux">r/linux</a> ' - "outside of this megathread, " - "please consider using <a " - 'href="/r/linuxquestions">r/linuxquestions</a> ' - "or <a " - 'href="/r/linux4noobs">r/linux4noobs</a> ' - "for the best solution to " - "your problem.</p>\n" - "\n" - "<p>Ask your hardware " - "requests here too or try " - "<a " - 'href="/r/linuxhardware">r/linuxhardware</a>!</p>\n' - "</div><!-- SC_ON " - "-->", - "spoiler": False, - "stickied": True, - "subreddit": "linux", - "subreddit_id": "t5_2qh1a", - "subreddit_name_prefixed": "r/linux", - "title": "Weekly Questions and Hardware " "Thread - July 01, 2020", - "url": "https://www.reddit.com/r/linux/comments/hj34ck/weekly_questions_and_hardware_thread_july_01_2020/", - "visited": False, - }, - "kind": "t3", - }, - { - "data": { - "archived": False, - "author": "AutoModerator", - "banned_at_utc": None, - "banned_by": None, - "category": None, - "created": 1593824903.0, - "created_utc": 1593796103.0, - "discussion_type": None, - "domain": "self.linux", - "edited": False, - "hidden": False, - "id": "hkmu0t", - "name": "t3_hkmu0t", - "permalink": "/r/linux/comments/hkmu0t/weekend_fluff_linux_in_the_wild_thread_july_03/", - "pinned": False, - "saved": False, - "selftext": "Welcome to the weekend! This " - "stickied thread is for you to " - "post pictures of your ubuntu " - "2006 install disk, slackware " - "floppies, on-topic memes or " - "more.\n" - "\n" - "When it's not the weekend, be " - "sure to check out " - "r/WildLinuxAppears or " - "r/linuxmemes!", - "selftext_html": "<!-- SC_OFF " - "--><div " - 'class="md"><p>Welcome ' - "to the weekend! This " - "stickied thread is for you " - "to post pictures of your " - "ubuntu 2006 install disk, " - "slackware floppies, " - "on-topic memes or " - "more.</p>\n" - "\n" - "<p>When it&#39;s " - "not the weekend, be sure to " - "check out <a " - 'href="/r/WildLinuxAppears">r/WildLinuxAppears</a> ' - "or <a " - 'href="/r/linuxmemes">r/linuxmemes</a>!</p>\n' - "</div><!-- SC_ON " - "-->", - "spoiler": False, - "stickied": True, - "subreddit": "linux", - "subreddit_id": "t5_2qh1a", - "subreddit_name_prefixed": "r/linux", - "subreddit_subscribers": 542073, - "subreddit_type": "public", - "thumbnail": "", - "title": "Weekend Fluff / Linux in the Wild " - "Thread - July 03, 2020", - "url": "https://www.reddit.com/r/linux/comments/hkmu0t/weekend_fluff_linux_in_the_wild_thread_july_03/", - "visited": False, - }, - "kind": "t3", - }, - ], - "dist": 27, - "modhash": None, - }, - "kind": "Listing", -} diff --git a/src/newsreader/news/collection/tests/reddit/client/tests.py b/src/newsreader/news/collection/tests/reddit/client/tests.py deleted file mode 100644 index a334346..0000000 --- a/src/newsreader/news/collection/tests/reddit/client/tests.py +++ /dev/null @@ -1,163 +0,0 @@ -from unittest.mock import Mock, patch -from uuid import uuid4 - -from django.test import TestCase -from django.utils.lorem_ipsum import words - -from newsreader.accounts.tests.factories import UserFactory -from newsreader.news.collection.exceptions import ( - StreamDeniedException, - StreamException, - StreamNotFoundException, - StreamParseException, - StreamTimeOutException, - StreamTooManyException, -) -from newsreader.news.collection.reddit import RedditClient -from newsreader.news.collection.tests.factories import SubredditFactory - -from .mocks import simple_mock - - -class RedditClientTestCase(TestCase): - def setUp(self): - self.maxDiff = None - - self.patched_read = patch("newsreader.news.collection.reddit.RedditStream.read") - self.mocked_read = self.patched_read.start() - - def tearDown(self): - patch.stopall() - - def test_client_retrieves_single_rules(self): - subreddit = SubredditFactory() - mock_stream = Mock(rule=subreddit) - - self.mocked_read.return_value = (simple_mock, mock_stream) - - with RedditClient([[subreddit]]) as client: - for data, stream in client: - with self.subTest(data=data, stream=stream): - self.assertEquals(data, simple_mock) - self.assertEquals(stream, mock_stream) - - self.mocked_read.assert_called_once_with() - - def test_client_catches_stream_exception(self): - subreddit = SubredditFactory() - - self.mocked_read.side_effect = StreamException(message="Stream exception") - - with RedditClient([[subreddit]]) as client: - for data, stream in client: - with self.subTest(data=data, stream=stream): - self.assertEquals(data, None) - self.assertEquals(stream, None) - self.assertEquals(stream.rule.error, "Stream exception") - self.assertEquals(stream.rule.succeeded, False) - - self.mocked_read.assert_called_once_with() - - def test_client_catches_stream_not_found_exception(self): - subreddit = SubredditFactory.create() - - self.mocked_read.side_effect = StreamNotFoundException( - message="Stream not found" - ) - - with RedditClient([[subreddit]]) as client: - for data, stream in client: - with self.subTest(data=data, stream=stream): - self.assertEquals(data, None) - self.assertEquals(stream, None) - self.assertEquals(stream.rule.error, "Stream not found") - self.assertEquals(stream.rule.succeeded, False) - - self.mocked_read.assert_called_once_with() - - @patch("newsreader.news.collection.reddit.RedditTokenTask") - def test_client_catches_stream_denied_exception(self, mocked_task): - user = UserFactory( - reddit_access_token=str(uuid4()), reddit_refresh_token=str(uuid4()) - ) - subreddit = SubredditFactory(user=user) - - self.mocked_read.side_effect = StreamDeniedException(message="Token expired") - - with RedditClient([(subreddit,)]) as client: - results = [(data, stream) for data, stream in client] - - self.mocked_read.assert_called_once_with() - mocked_task.delay.assert_called_once_with(user.pk) - - self.assertEquals(len(results), 0) - - user.refresh_from_db() - subreddit.refresh_from_db() - - self.assertEquals(user.reddit_access_token, None) - self.assertEquals(subreddit.succeeded, False) - self.assertEquals(subreddit.error, "Token expired") - - def test_client_catches_stream_timed_out_exception(self): - subreddit = SubredditFactory() - - self.mocked_read.side_effect = StreamTimeOutException( - message="Stream timed out" - ) - - with RedditClient([[subreddit]]) as client: - for data, stream in client: - with self.subTest(data=data, stream=stream): - self.assertEquals(data, None) - self.assertEquals(stream, None) - self.assertEquals(stream.rule.error, "Stream timed out") - self.assertEquals(stream.rule.succeeded, False) - - self.mocked_read.assert_called_once_with() - - def test_client_catches_stream_too_many_exception(self): - subreddit = SubredditFactory() - - self.mocked_read.side_effect = StreamTooManyException - - with RedditClient([[subreddit]]) as client: - for data, stream in client: - with self.subTest(data=data, stream=stream): - self.assertEquals(data, None) - self.assertEquals(stream, None) - self.assertEquals(stream.rule.error, "Too many requests") - self.assertEquals(stream.rule.succeeded, False) - - self.mocked_read.assert_called_once_with() - - def test_client_catches_stream_parse_exception(self): - subreddit = SubredditFactory() - - self.mocked_read.side_effect = StreamParseException( - message="Stream could not be parsed" - ) - - with RedditClient([[subreddit]]) as client: - for data, stream in client: - with self.subTest(data=data, stream=stream): - self.assertEquals(data, None) - self.assertEquals(stream, None) - self.assertEquals(stream.rule.error, "Stream could not be parsed") - self.assertEquals(stream.rule.succeeded, False) - - self.mocked_read.assert_called_once_with() - - def test_client_catches_long_exception_text(self): - subreddit = SubredditFactory() - - self.mocked_read.side_effect = StreamParseException(message=words(1000)) - - with RedditClient([[subreddit]]) as client: - for data, stream in client: - self.assertEquals(data, None) - self.assertEquals(stream, None) - self.assertEquals(len(stream.rule.error), 1024) - self.assertEquals(stream.rule.succeeded, False) - - self.mocked_read.assert_called_once_with() diff --git a/src/newsreader/news/collection/tests/reddit/collector/__init__.py b/src/newsreader/news/collection/tests/reddit/collector/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/newsreader/news/collection/tests/reddit/collector/mocks.py b/src/newsreader/news/collection/tests/reddit/collector/mocks.py deleted file mode 100644 index 37d40d8..0000000 --- a/src/newsreader/news/collection/tests/reddit/collector/mocks.py +++ /dev/null @@ -1,1662 +0,0 @@ -simple_mock_1 = { - "kind": "Listing", - "data": { - "modhash": "khwcr8tmp613f1b92d55150adb744983e7f6c37e87e30f6432", - "dist": 26, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "starcitizen", - "selftext": "Welcome to the Star Citizen question and answer thread. Feel free to ask any questions you have related to SC here!\r\n\r\n---\r\n\r\nUseful Links and Resources:\r\n\r\n[Star Citizen Wiki](https://starcitizen.tools) - *The biggest and best wiki resource dedicated to Star Citizen*\r\n\r\n[Star Citizen FAQ](https://starcitizen.tools/Frequently_Asked_Questions) - *Chances the answer you need is here.* \r\n\r\n[Discord Help Channel](https://discord.gg/0STCP5tSe7x9NBSq) - *Often times community members will be here to help you with issues.*\r\n\r\n[Referral Code Randomizer](http://gorefer.me/starcitizen) - *Use this when creating a new account to get 5000 extra UEC.*\r\n\r\n[Download Star Citizen](https://robertsspaceindustries.com/download) - *Get the latest version of Star Citizen here*\r\n\r\n[Current Game Features](https://robertsspaceindustries.com/feature-list) - *Click here to see what you can currently do in Star Citizen.*\r\n\r\n[Development Roadmap](https://robertsspaceindustries.com/roadmap/board/1-Star-Citizen) - *The current development status of up and coming Star Citizen features.*\r\n\r\n[Pledge FAQ](https://support.robertsspaceindustries.com/hc/en-us/articles/115013194987-Pledges-FAQs) - *Official FAQ regarding spending money on the game.*", - "author_fullname": "t2_otk50", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Star Citizen: Question and Answer Thread", - "link_flair_richtext": [{"e": "text", "t": "QUESTION"}], - "subreddit_name_prefixed": "r/starcitizen", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "QUESTION", - "downs": 0, - "thumbnail_height": None, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm6byg", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.9, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 21, - "total_awards_received": 0, - "media_embed": {}, - "thumbnail_width": None, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "QUESTION", - "can_mod_post": False, - "score": 21, - "approved_by": None, - "author_premium": False, - "thumbnail": "self", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "post_hint": "self", - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594065605, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.starcitizen", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to the Star Citizen question and answer thread. Feel free to ask any questions you have related to SC here!</p>\n\n<hr/>\n\n<p>Useful Links and Resources:</p>\n\n<p><a href="https://starcitizen.tools">Star Citizen Wiki</a> - <em>The biggest and best wiki resource dedicated to Star Citizen</em></p>\n\n<p><a href="https://starcitizen.tools/Frequently_Asked_Questions">Star Citizen FAQ</a> - <em>Chances the answer you need is here.</em> </p>\n\n<p><a href="https://discord.gg/0STCP5tSe7x9NBSq">Discord Help Channel</a> - <em>Often times community members will be here to help you with issues.</em></p>\n\n<p><a href="http://gorefer.me/starcitizen">Referral Code Randomizer</a> - <em>Use this when creating a new account to get 5000 extra UEC.</em></p>\n\n<p><a href="https://robertsspaceindustries.com/download">Download Star Citizen</a> - <em>Get the latest version of Star Citizen here</em></p>\n\n<p><a href="https://robertsspaceindustries.com/feature-list">Current Game Features</a> - <em>Click here to see what you can currently do in Star Citizen.</em></p>\n\n<p><a href="https://robertsspaceindustries.com/roadmap/board/1-Star-Citizen">Development Roadmap</a> - <em>The current development status of up and coming Star Citizen features.</em></p>\n\n<p><a href="https://support.robertsspaceindustries.com/hc/en-us/articles/115013194987-Pledges-FAQs">Pledge FAQ</a> - <em>Official FAQ regarding spending money on the game.</em></p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://external-preview.redd.it/5qLIX6ObbErxkDiTz24uP6TbZGNVNyy2SeXusPhzaKA.jpg?auto=webp&s=738b5270a81373916191470a1da34cdcc54d8511", - "width": 332, - "height": 360, - }, - "resolutions": [ - { - "url": "https://external-preview.redd.it/5qLIX6ObbErxkDiTz24uP6TbZGNVNyy2SeXusPhzaKA.jpg?width=108&crop=smart&auto=webp&s=e2ee2a9dae15472663b52c8cb4e002fdbbb6378c", - "width": 108, - "height": 117, - }, - { - "url": "https://external-preview.redd.it/5qLIX6ObbErxkDiTz24uP6TbZGNVNyy2SeXusPhzaKA.jpg?width=216&crop=smart&auto=webp&s=3690c60a9b533d376f159f306c6667b47ff42102", - "width": 216, - "height": 234, - }, - { - "url": "https://external-preview.redd.it/5qLIX6ObbErxkDiTz24uP6TbZGNVNyy2SeXusPhzaKA.jpg?width=320&crop=smart&auto=webp&s=4dcb434a5071329ecbb9f3543e4d06442ab141df", - "width": 320, - "height": 346, - }, - ], - "variants": {}, - "id": "KTE3H6RnWCasOJCFtdmgmw51FMzxSqXz_SRD6W5Rdsc", - } - ], - "enabled": False, - }, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2v94d", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm6byg", - "is_robot_indexable": True, - "report_reasons": None, - "author": "UEE_Central_Computer", - "discussion_type": None, - "num_comments": 380, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/starcitizen/comments/hm6byg/star_citizen_question_and_answer_thread/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/starcitizen/comments/hm6byg/star_citizen_question_and_answer_thread/", - "subreddit_subscribers": 213071, - "created_utc": 1594036805, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "starcitizen", - "selftext": "", - "author_fullname": "t2_6wgp9w28", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "5 random people in a train felt like such a rare and special thing 😁", - "link_flair_richtext": [{"e": "text", "t": "FLUFF"}], - "subreddit_name_prefixed": "r/starcitizen", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "fluff", - "downs": 0, - "thumbnail_height": 78, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hpkhgj", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.98, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 892, - "total_awards_received": 0, - "media_embed": {}, - "thumbnail_width": 140, - "author_flair_template_id": "a87724f8-c2b5-11e4-b7e0-22000b2103f6", - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "FLUFF", - "can_mod_post": False, - "score": 892, - "approved_by": None, - "author_premium": False, - "thumbnail": "https://b.thumbs.redditmedia.com/YlF6BTm-DfnrZBeukYiOyrP-Fkj2xUQtk_V8ZeUD93w.jpg", - "edited": False, - "author_flair_css_class": "aurora", - "author_flair_richtext": [ - {"e": "text", "t": "🌌2013Backer🎮vGameDev🌌"} - ], - "gildings": {}, - "post_hint": "image", - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594540209, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/0jkge020fba51.png", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://preview.redd.it/0jkge020fba51.png?auto=webp&s=c3a2b8cb860f839638a364d49abca04fd4f42094", - "width": 2560, - "height": 1440, - }, - "resolutions": [ - { - "url": "https://preview.redd.it/0jkge020fba51.png?width=108&crop=smart&auto=webp&s=778a7f7d9b2e0d713161e84b32c467ebde6cbc17", - "width": 108, - "height": 60, - }, - { - "url": "https://preview.redd.it/0jkge020fba51.png?width=216&crop=smart&auto=webp&s=53afc50cc2dd6c72470e76a4c3ff8ef597f66e0d", - "width": 216, - "height": 121, - }, - { - "url": "https://preview.redd.it/0jkge020fba51.png?width=320&crop=smart&auto=webp&s=089f9ff42e429b5062c143695e695cbb4ea5b679", - "width": 320, - "height": 180, - }, - { - "url": "https://preview.redd.it/0jkge020fba51.png?width=640&crop=smart&auto=webp&s=045327ac6fd113630c0faef426d86efaf04f55e2", - "width": 640, - "height": 360, - }, - { - "url": "https://preview.redd.it/0jkge020fba51.png?width=960&crop=smart&auto=webp&s=efbdc9ddcda1207fafa20bb45e82fbe24ed37df8", - "width": 960, - "height": 540, - }, - { - "url": "https://preview.redd.it/0jkge020fba51.png?width=1080&crop=smart&auto=webp&s=1b94c9951c60a788357dfa0fe21dd983efdcf1e7", - "width": 1080, - "height": 607, - }, - ], - "variants": {}, - "id": "r-JjrJn0RtZLaxMk_d-TCfW80pWgJ-5kjMaje54J5_I", - } - ], - "enabled": True, - }, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "db099dc4-3538-11e5-97ec-0e7f0fa558f9", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": "🌌2013Backer🎮vGameDev🌌", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2v94d", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#007373", - "id": "hpkhgj", - "is_robot_indexable": True, - "report_reasons": None, - "author": "Y_DK_Y", - "discussion_type": None, - "num_comments": 39, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/starcitizen/comments/hpkhgj/5_random_people_in_a_train_felt_like_such_a_rare/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/0jkge020fba51.png", - "subreddit_subscribers": 213071, - "created_utc": 1594511409, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "starcitizen", - "selftext": "", - "author_fullname": "t2_4brylpu5", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Drake Interplanetary Smartkey thing that I made!", - "link_flair_richtext": [{"e": "text", "t": "ARTWORK"}], - "subreddit_name_prefixed": "r/starcitizen", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "artwork", - "downs": 0, - "thumbnail_height": 78, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hph00n", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.97, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 547, - "total_awards_received": 1, - "media_embed": {}, - "thumbnail_width": 140, - "author_flair_template_id": None, - "is_original_content": True, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "ARTWORK", - "can_mod_post": False, - "score": 547, - "approved_by": None, - "author_premium": False, - "thumbnail": "https://b.thumbs.redditmedia.com/gr7RYEjNN5FNc42LxuizFW_ZxWtS3xbZj1QfhIa-2Hw.jpg", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "post_hint": "image", - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594527804, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/b6h74eljeaa51.png", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://preview.redd.it/b6h74eljeaa51.png?auto=webp&s=fd286c2dcd98378c34fde6e245cf13c357716dca", - "width": 1920, - "height": 1080, - }, - "resolutions": [ - { - "url": "https://preview.redd.it/b6h74eljeaa51.png?width=108&crop=smart&auto=webp&s=3150c2a2643d178eba735cb0bc222b8b29f46c8c", - "width": 108, - "height": 60, - }, - { - "url": "https://preview.redd.it/b6h74eljeaa51.png?width=216&crop=smart&auto=webp&s=9120ce40ce7439ca4d3431da7782a8c6acd2eebf", - "width": 216, - "height": 121, - }, - { - "url": "https://preview.redd.it/b6h74eljeaa51.png?width=320&crop=smart&auto=webp&s=83cd5c93fe7a19e5643df38eec3aefee54912faf", - "width": 320, - "height": 180, - }, - { - "url": "https://preview.redd.it/b6h74eljeaa51.png?width=640&crop=smart&auto=webp&s=b3e280a4a7fbaf794692c01f4ff63af0b8559700", - "width": 640, - "height": 360, - }, - { - "url": "https://preview.redd.it/b6h74eljeaa51.png?width=960&crop=smart&auto=webp&s=8ebac203688ba0e42c7975f3d7688dab25fc065b", - "width": 960, - "height": 540, - }, - { - "url": "https://preview.redd.it/b6h74eljeaa51.png?width=1080&crop=smart&auto=webp&s=8350e0b4e004820ef9f30501397d49a2121186ec", - "width": 1080, - "height": 607, - }, - ], - "variants": {}, - "id": "B2HxXfFibxKUtHO9eBwT-Bt_VrE870XhC0R5OFA95rI", - } - ], - "enabled": True, - }, - "all_awardings": [ - { - "giver_coin_reward": 0, - "subreddit_id": None, - "is_new": False, - "days_of_drip_extension": 0, - "coin_price": 50, - "id": "award_02d9ab2c-162e-4c01-8438-317a016ed3d9", - "penny_donate": 0, - "award_sub_type": "GLOBAL", - "coin_reward": 0, - "icon_url": "https://i.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png", - "days_of_premium": 0, - "resized_icons": [ - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=16&height=16&auto=webp&s=92e96be1dbd278dc987fbd9acc1bd5078566f254", - "width": 16, - "height": 16, - }, - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=32&height=32&auto=webp&s=83e14655f2b162b295f7d2c7058b9ad94cf8b73c", - "width": 32, - "height": 32, - }, - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=48&height=48&auto=webp&s=83038a4d6181d3c8f5107dbca4ddb735ca6c2231", - "width": 48, - "height": 48, - }, - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=64&height=64&auto=webp&s=3c4e39a7664d799ff50f32e9a3f96c3109d2e266", - "width": 64, - "height": 64, - }, - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=128&height=128&auto=webp&s=390bf9706b8e1a6215716ebcf6363373f125c339", - "width": 128, - "height": 128, - }, - ], - "icon_width": 2048, - "static_icon_width": 2048, - "start_date": None, - "is_enabled": True, - "description": "I'm in this with you.", - "end_date": None, - "subreddit_coin_reward": 0, - "count": 1, - "static_icon_height": 2048, - "name": "Take My Energy", - "resized_static_icons": [ - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=16&height=16&auto=webp&s=92e96be1dbd278dc987fbd9acc1bd5078566f254", - "width": 16, - "height": 16, - }, - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=32&height=32&auto=webp&s=83e14655f2b162b295f7d2c7058b9ad94cf8b73c", - "width": 32, - "height": 32, - }, - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=48&height=48&auto=webp&s=83038a4d6181d3c8f5107dbca4ddb735ca6c2231", - "width": 48, - "height": 48, - }, - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=64&height=64&auto=webp&s=3c4e39a7664d799ff50f32e9a3f96c3109d2e266", - "width": 64, - "height": 64, - }, - { - "url": "https://preview.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png?width=128&height=128&auto=webp&s=390bf9706b8e1a6215716ebcf6363373f125c339", - "width": 128, - "height": 128, - }, - ], - "icon_format": "PNG", - "icon_height": 2048, - "penny_price": 0, - "award_type": "global", - "static_icon_url": "https://i.redd.it/award_images/t5_22cerq/898sygoknoo41_TakeMyEnergy.png", - } - ], - "awarders": [], - "media_only": False, - "link_flair_template_id": "e3bb68b2-3538-11e5-bf5a-0e09b4299f63", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2v94d", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#ff66ac", - "id": "hph00n", - "is_robot_indexable": True, - "report_reasons": None, - "author": "HannahB888", - "discussion_type": None, - "num_comments": 38, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/starcitizen/comments/hph00n/drake_interplanetary_smartkey_thing_that_i_made/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/b6h74eljeaa51.png", - "subreddit_subscribers": 213071, - "created_utc": 1594499004, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "starcitizen", - "selftext": "", - "author_fullname": "t2_exlc6", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "A Historical Moment for CIG", - "link_flair_richtext": [{"e": "text", "t": "FLUFF"}], - "subreddit_name_prefixed": "r/starcitizen", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "fluff", - "downs": 0, - "thumbnail_height": 37, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hp9mlw", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.98, - "author_flair_background_color": "", - "subreddit_type": "public", - "ups": 1444, - "total_awards_received": 0, - "media_embed": {}, - "thumbnail_width": 140, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "FLUFF", - "can_mod_post": False, - "score": 1444, - "approved_by": None, - "author_premium": False, - "thumbnail": "https://b.thumbs.redditmedia.com/YYdiE2x8fsn0ckVJiGCnBzUIOa1DA03ALh3TJuVlZks.jpg", - "edited": False, - "author_flair_css_class": "carrack", - "author_flair_richtext": [{"e": "text", "t": "AHV Artemis"}], - "gildings": {}, - "post_hint": "image", - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594501406, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/fdh2ujp388a51.png", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://preview.redd.it/fdh2ujp388a51.png?auto=webp&s=605044c2757c1b5ca9060d3ec448090396a2f0dd", - "width": 424, - "height": 114, - }, - "resolutions": [ - { - "url": "https://preview.redd.it/fdh2ujp388a51.png?width=108&crop=smart&auto=webp&s=9789c6b76d45e46645fe2454555bfbd042a39815", - "width": 108, - "height": 29, - }, - { - "url": "https://preview.redd.it/fdh2ujp388a51.png?width=216&crop=smart&auto=webp&s=3f419183835c883f10b1caab3a7ecbec4ebbf3ec", - "width": 216, - "height": 58, - }, - { - "url": "https://preview.redd.it/fdh2ujp388a51.png?width=320&crop=smart&auto=webp&s=695ff914462b5b9bc253ce26f4a51f5f22641148", - "width": 320, - "height": 86, - }, - ], - "variants": {}, - "id": "XWdU5CBWG0-5mOzBRF65OnvZzQm2Btd2ldGMeJ8u_gI", - } - ], - "enabled": True, - }, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "db099dc4-3538-11e5-97ec-0e7f0fa558f9", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": "AHV Artemis", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2v94d", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#007373", - "id": "hp9mlw", - "is_robot_indexable": True, - "report_reasons": None, - "author": "sam00197", - "discussion_type": None, - "num_comments": 194, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/starcitizen/comments/hp9mlw/a_historical_moment_for_cig/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/fdh2ujp388a51.png", - "subreddit_subscribers": 213071, - "created_utc": 1594472606, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "starcitizen", - "selftext": "", - "author_fullname": "t2_4dgjlpn7", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "This view. What's your favorite moon?", - "link_flair_richtext": [{"e": "text", "t": "DISCUSSION"}], - "subreddit_name_prefixed": "r/starcitizen", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "discussion", - "downs": 0, - "thumbnail_height": 78, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hpjn8x", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.96, - "author_flair_background_color": "", - "subreddit_type": "public", - "ups": 182, - "total_awards_received": 0, - "media_embed": {}, - "thumbnail_width": 140, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "DISCUSSION", - "can_mod_post": False, - "score": 182, - "approved_by": None, - "author_premium": False, - "thumbnail": "https://a.thumbs.redditmedia.com/tKHL_2fn4Zo9FhrtP3UiJlQA7xkMU7-iN0ntJbhfa80.jpg", - "edited": False, - "author_flair_css_class": "", - "author_flair_richtext": [{"e": "text", "t": "new user/low karma"}], - "gildings": {}, - "post_hint": "image", - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594537150, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/ovly7f9g6ba51.jpg", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "preview": { - "images": [ - { - "source": { - "url": "https://preview.redd.it/ovly7f9g6ba51.jpg?auto=webp&s=d7051e4c713e39c642c583e5e8ada57c9660fa26", - "width": 2560, - "height": 1440, - }, - "resolutions": [ - { - "url": "https://preview.redd.it/ovly7f9g6ba51.jpg?width=108&crop=smart&auto=webp&s=35f6ebe4531c12bc24532f01741bcf8100d954b2", - "width": 108, - "height": 60, - }, - { - "url": "https://preview.redd.it/ovly7f9g6ba51.jpg?width=216&crop=smart&auto=webp&s=a939922e34cf4ff6a82eeb22e71acb816ccc6d7b", - "width": 216, - "height": 121, - }, - { - "url": "https://preview.redd.it/ovly7f9g6ba51.jpg?width=320&crop=smart&auto=webp&s=9796767ed73e04a774d2f1ba8cf3662bbd4195eb", - "width": 320, - "height": 180, - }, - { - "url": "https://preview.redd.it/ovly7f9g6ba51.jpg?width=640&crop=smart&auto=webp&s=37fe4c262b752cb8dac903daf606be8f0ac3b44f", - "width": 640, - "height": 360, - }, - { - "url": "https://preview.redd.it/ovly7f9g6ba51.jpg?width=960&crop=smart&auto=webp&s=305245fd1d352634c86459131b11238fe09f5d2b", - "width": 960, - "height": 540, - }, - { - "url": "https://preview.redd.it/ovly7f9g6ba51.jpg?width=1080&crop=smart&auto=webp&s=e8438e4b666cf616646ffad09c153d120df1f1d9", - "width": 1080, - "height": 607, - }, - ], - "variants": {}, - "id": "SjRqA5h_B55WLnwAlocF6wcxIHZLgGBMpmb5nV1EQ4E", - } - ], - "enabled": True, - }, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "ca858044-1916-11e2-a9b9-12313d168e98", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": "new user/low karma", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2v94d", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#014980", - "id": "hpjn8x", - "is_robot_indexable": True, - "report_reasons": None, - "author": "clericanubis", - "discussion_type": None, - "num_comments": 27, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/starcitizen/comments/hpjn8x/this_view_whats_your_favorite_moon/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/ovly7f9g6ba51.jpg", - "subreddit_subscribers": 213071, - "created_utc": 1594508350, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hplinp", - "before": None, - }, -} - -simple_mock_2 = { - "kind": "Listing", - "data": { - "modhash": "y4he8gfzh9f892e2bf3094bc06daba2e02288e617fecf555b5", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "Python", - "selftext": "Top Level comments must be **Job Opportunities.**\n\nPlease include **Location** or any other **Requirements** in your comment. If you require people to work on site in San Francisco, *you must note that in your post.* If you require an Engineering degree, *you must note that in your post*.\n\nPlease include as much information as possible.\n\nIf you are looking for jobs, send a PM to the poster.", - "author_fullname": "t2_628u", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "/r/Python Job Board for May, June, July", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/Python", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_gdfaip", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.98, - "author_flair_background_color": "", - "subreddit_type": "public", - "ups": 108, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 108, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": "", - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1588640187, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.Python", - "allow_live_comments": True, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Top Level comments must be <strong>Job Opportunities.</strong></p>\n\n<p>Please include <strong>Location</strong> or any other <strong>Requirements</strong> in your comment. If you require people to work on site in San Francisco, <em>you must note that in your post.</em> If you require an Engineering degree, <em>you must note that in your post</em>.</p>\n\n<p>Please include as much information as possible.</p>\n\n<p>If you are looking for jobs, send a PM to the poster.</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": "reticulated", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh0y", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "gdfaip", - "is_robot_indexable": True, - "report_reasons": None, - "author": "aphoenix", - "discussion_type": None, - "num_comments": 38, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/Python/comments/gdfaip/rpython_job_board_for_may_june_july/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/Python/comments/gdfaip/rpython_job_board_for_may_june_july/", - "subreddit_subscribers": 616297, - "created_utc": 1588611387, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "Python", - "selftext": "# EDIT: AMA complete. Huge thanks to the PyCharm Team for holding this!\n\nAs mentioned in the comments you can use code `reddit20202` at [https://www.jetbrains.com/store/redeem/](https://www.jetbrains.com/store/redeem/) to try out PyCharm Professional as a new JetBrains customer!\n\nWe will be joined by members of the PyCharm Developer team from JetBrains to answer all sorts of questions on the PyCharm IDE and the Python language!\n\n[PyCharm](https://www.jetbrains.com/pycharm/) is the professional IDE for Python Developers with over 33% of respondents from the [2019 Python Developers Survey](https://www.jetbrains.com/lp/python-developers-survey-2019/) choosing it as their main editor.\n\nPyCharm features smart autocompletion, on-the-fly error checking and quick fixes as well as PEP8 compliance detection and automatic refactoring.\n\nIf you haven't checked out PyCharm then you definitely should, the Community Edition of PyCharm includes many key features such as the debugger, test runners, intelligent code completion and more!\n\nIf you are looking for a professional IDE for Python then the PyCharm Professional edition adds features such as advanced web development tools and database/SQL support, if you are a student or maintain an open source project make sure to take a look at the generous discounts JetBrains offer for their products!\n\nThe AMA will begin at 16:00 UTC on the 9th of July. Feel free to drop questions below for the PyCharm team to answer!\n\nWe will be joined by:\n\n* Nafiul Islam, u/nafiulislamjb (Developer Advocate for PyCharm)\n* Andrey Vlasovskikh, u/vlasovskikh (PyCharm Team Lead)", - "user_reports": [], - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "AMA with PyCharm team from JetBrains on 9th July @ 16:00 UTC", - "event_start": 1594310400, - "subreddit_name_prefixed": "r/Python", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "editors", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hmd2ez", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.94, - "author_flair_background_color": "", - "subreddit_type": "public", - "ups": 60, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "author_fullname": "t2_145f96", - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Editors / IDEs", - "can_mod_post": False, - "score": 60, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": 1594321779, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594088635, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.Python", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><h1>EDIT: AMA complete. Huge thanks to the PyCharm Team for holding this!</h1>\n\n<p>As mentioned in the comments you can use code <code>reddit20202</code> at <a href="https://www.jetbrains.com/store/redeem/">https://www.jetbrains.com/store/redeem/</a> to try out PyCharm Professional as a new JetBrains customer!</p>\n\n<p>We will be joined by members of the PyCharm Developer team from JetBrains to answer all sorts of questions on the PyCharm IDE and the Python language!</p>\n\n<p><a href="https://www.jetbrains.com/pycharm/">PyCharm</a> is the professional IDE for Python Developers with over 33% of respondents from the <a href="https://www.jetbrains.com/lp/python-developers-survey-2019/">2019 Python Developers Survey</a> choosing it as their main editor.</p>\n\n<p>PyCharm features smart autocompletion, on-the-fly error checking and quick fixes as well as PEP8 compliance detection and automatic refactoring.</p>\n\n<p>If you haven&#39;t checked out PyCharm then you definitely should, the Community Edition of PyCharm includes many key features such as the debugger, test runners, intelligent code completion and more!</p>\n\n<p>If you are looking for a professional IDE for Python then the PyCharm Professional edition adds features such as advanced web development tools and database/SQL support, if you are a student or maintain an open source project make sure to take a look at the generous discounts JetBrains offer for their products!</p>\n\n<p>The AMA will begin at 16:00 UTC on the 9th of July. Feel free to drop questions below for the PyCharm team to answer!</p>\n\n<p>We will be joined by:</p>\n\n<ul>\n<li>Nafiul Islam, <a href="/u/nafiulislamjb">u/nafiulislamjb</a> (Developer Advocate for PyCharm)</li>\n<li>Andrey Vlasovskikh, <a href="/u/vlasovskikh">u/vlasovskikh</a> (PyCharm Team Lead)</li>\n</ul>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "confidence", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "49f2747c-4114-11ea-b9fe-0e741fe75651", - "link_flair_richtext": [], - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": "Owner of Python Discord", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh0y", - "event_end": 1594324800, - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "event_is_live": False, - "id": "hmd2ez", - "is_robot_indexable": True, - "report_reasons": None, - "author": "Im__Joseph", - "discussion_type": None, - "num_comments": 65, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/Python/comments/hmd2ez/ama_with_pycharm_team_from_jetbrains_on_9th_july/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/Python/comments/hmd2ez/ama_with_pycharm_team_from_jetbrains_on_9th_july/", - "subreddit_subscribers": 616297, - "created_utc": 1594059835, - "num_crossposts": 2, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "Python", - "selftext": "", - "author_fullname": "t2_woll6", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "I am a medical student, and I recently programmed an open-source eye-tracker for brain research", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/Python", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "made-this", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hpr28u", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.99, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 439, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": "4cc838b8-3159-11e1-83e4-12313d18ad57", - "is_original_content": False, - "user_reports": [], - "secure_media": { - "reddit_video": { - "fallback_url": "https://v.redd.it/tqzx750wzda51/DASH_360.mp4?source=fallback", - "height": 384, - "width": 512, - "scrubber_media_url": "https://v.redd.it/tqzx750wzda51/DASH_96.mp4", - "dash_url": "https://v.redd.it/tqzx750wzda51/DASHPlaylist.mpd?a=1597142191%2CY2JkNmU5Y2FmZGM1NzA5MjhkYTk5NjdmMWRmNWI4M2I2N2Q2MjA5NmIzZWRmODJiMjk0MzY4OTZlYTBiZmZlZg%3D%3D&v=1&f=sd", - "duration": 31, - "hls_url": "https://v.redd.it/tqzx750wzda51/HLSPlaylist.m3u8?a=1597142191%2CZDVhNWNjMGQ0OTBjOTU0Zjk5MDgwZmE2YzA1MGY5YzNlZThmZTAxZTgxODIxMGFjZDdlYzczOWFlYTcyMmMzNg%3D%3D&v=1&f=sd", - "is_gif": False, - "transcoding_status": "completed", - } - }, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "I Made This", - "can_mod_post": False, - "score": 439, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594571350, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "v.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://v.redd.it/tqzx750wzda51", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "d7dfae22-4113-11ea-b9fe-0e741fe75651", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": "Neuroscientist", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh0y", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hpr28u", - "is_robot_indexable": True, - "report_reasons": None, - "author": "Sebaron", - "discussion_type": None, - "num_comments": 33, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/Python/comments/hpr28u/i_am_a_medical_student_and_i_recently_programmed/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://v.redd.it/tqzx750wzda51", - "subreddit_subscribers": 616297, - "created_utc": 1594542550, - "num_crossposts": 0, - "media": { - "reddit_video": { - "fallback_url": "https://v.redd.it/tqzx750wzda51/DASH_360.mp4?source=fallback", - "height": 384, - "width": 512, - "scrubber_media_url": "https://v.redd.it/tqzx750wzda51/DASH_96.mp4", - "dash_url": "https://v.redd.it/tqzx750wzda51/DASHPlaylist.mpd?a=1597142191%2CY2JkNmU5Y2FmZGM1NzA5MjhkYTk5NjdmMWRmNWI4M2I2N2Q2MjA5NmIzZWRmODJiMjk0MzY4OTZlYTBiZmZlZg%3D%3D&v=1&f=sd", - "duration": 31, - "hls_url": "https://v.redd.it/tqzx750wzda51/HLSPlaylist.m3u8?a=1597142191%2CZDVhNWNjMGQ0OTBjOTU0Zjk5MDgwZmE2YzA1MGY5YzNlZThmZTAxZTgxODIxMGFjZDdlYzczOWFlYTcyMmMzNg%3D%3D&v=1&f=sd", - "is_gif": False, - "transcoding_status": "completed", - } - }, - "is_video": True, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "Python", - "selftext": "", - "author_fullname": "t2_6zgzj94n", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "I made a filename simplifier which removes unnecessary tags, metadata, dashes, dots, underscores, and non-English characters from filenames (and folders) to give your library a neat look.", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/Python", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "made-this", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hpps6f", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.95, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 258, - "total_awards_received": 1, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": { - "reddit_video": { - "fallback_url": "https://v.redd.it/jq229anzada51/DASH_1080.mp4?source=fallback", - "height": 1080, - "width": 1920, - "scrubber_media_url": "https://v.redd.it/jq229anzada51/DASH_96.mp4", - "dash_url": "https://v.redd.it/jq229anzada51/DASHPlaylist.mpd?a=1597142191%2CZDU4Y2FmYzI2NjMzZTMxNzJkOThiMzJmYzBlOTMyMmEwNTg3MTFhMmU0OWZjZDljZGQ4MjAwMTgxMGVhYzU1OQ%3D%3D&v=1&f=sd", - "duration": 27, - "hls_url": "https://v.redd.it/jq229anzada51/HLSPlaylist.m3u8?a=1597142191%2CYmY1Y2Q5ZjQ0ZWVmODAxODQ3MGU3YzA1YzIxOTEzODFlNWQyMjE4MzAyYzNiMDM5NTI0N2M5OTRmY2YwN2NlOA%3D%3D&v=1&f=sd", - "is_gif": False, - "transcoding_status": "completed", - } - }, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "I Made This", - "can_mod_post": False, - "score": 258, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594563987, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "v.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://v.redd.it/jq229anzada51", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [ - { - "giver_coin_reward": 0, - "subreddit_id": None, - "is_new": False, - "days_of_drip_extension": 0, - "coin_price": 75, - "id": "award_9663243a-e77f-44cf-abc6-850ead2cd18d", - "penny_donate": 0, - "award_sub_type": "PREMIUM", - "coin_reward": 0, - "icon_url": "https://www.redditstatic.com/gold/awards/icon/SnooClappingPremium_512.png", - "days_of_premium": 0, - "resized_icons": [ - { - "url": "https://www.redditstatic.com/gold/awards/icon/SnooClappingPremium_16.png", - "width": 16, - "height": 16, - }, - { - "url": "https://www.redditstatic.com/gold/awards/icon/SnooClappingPremium_32.png", - "width": 32, - "height": 32, - }, - { - "url": "https://www.redditstatic.com/gold/awards/icon/SnooClappingPremium_48.png", - "width": 48, - "height": 48, - }, - { - "url": "https://www.redditstatic.com/gold/awards/icon/SnooClappingPremium_64.png", - "width": 64, - "height": 64, - }, - { - "url": "https://www.redditstatic.com/gold/awards/icon/SnooClappingPremium_128.png", - "width": 128, - "height": 128, - }, - ], - "icon_width": 512, - "static_icon_width": 512, - "start_date": None, - "is_enabled": True, - "description": "For an especially amazing showing.", - "end_date": None, - "subreddit_coin_reward": 0, - "count": 1, - "static_icon_height": 512, - "name": "Bravo Grande!", - "resized_static_icons": [ - { - "url": "https://preview.redd.it/award_images/t5_q0gj4/59e02tmkl4451_BravoGrande-Static.png?width=16&height=16&auto=webp&s=3459bdf1d1777821a831c5bf9834f4365263fcff", - "width": 16, - "height": 16, - }, - { - "url": "https://preview.redd.it/award_images/t5_q0gj4/59e02tmkl4451_BravoGrande-Static.png?width=32&height=32&auto=webp&s=9181d68065ccfccf2b1074e499cd7c1103aa2ce8", - "width": 32, - "height": 32, - }, - { - "url": "https://preview.redd.it/award_images/t5_q0gj4/59e02tmkl4451_BravoGrande-Static.png?width=48&height=48&auto=webp&s=339b368d395219120abc50d54fb3e2cdcad8ca4f", - "width": 48, - "height": 48, - }, - { - "url": "https://preview.redd.it/award_images/t5_q0gj4/59e02tmkl4451_BravoGrande-Static.png?width=64&height=64&auto=webp&s=de4ebbe92f9019de05aaa77f88810d44adbe1e50", - "width": 64, - "height": 64, - }, - { - "url": "https://preview.redd.it/award_images/t5_q0gj4/59e02tmkl4451_BravoGrande-Static.png?width=128&height=128&auto=webp&s=ba6c1add5204ea43e5af010bd9622392a42140e3", - "width": 128, - "height": 128, - }, - ], - "icon_format": "APNG", - "icon_height": 512, - "penny_price": 0, - "award_type": "global", - "static_icon_url": "https://i.redd.it/award_images/t5_q0gj4/59e02tmkl4451_BravoGrande-Static.png", - } - ], - "awarders": [], - "media_only": False, - "link_flair_template_id": "d7dfae22-4113-11ea-b9fe-0e741fe75651", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh0y", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hpps6f", - "is_robot_indexable": True, - "report_reasons": None, - "author": "Hobo-TheGodOfPoverty", - "discussion_type": None, - "num_comments": 25, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/Python/comments/hpps6f/i_made_a_filename_simplifier_which_removes/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://v.redd.it/jq229anzada51", - "subreddit_subscribers": 616297, - "created_utc": 1594535187, - "num_crossposts": 0, - "media": { - "reddit_video": { - "fallback_url": "https://v.redd.it/jq229anzada51/DASH_1080.mp4?source=fallback", - "height": 1080, - "width": 1920, - "scrubber_media_url": "https://v.redd.it/jq229anzada51/DASH_96.mp4", - "dash_url": "https://v.redd.it/jq229anzada51/DASHPlaylist.mpd?a=1597142191%2CZDU4Y2FmYzI2NjMzZTMxNzJkOThiMzJmYzBlOTMyMmEwNTg3MTFhMmU0OWZjZDljZGQ4MjAwMTgxMGVhYzU1OQ%3D%3D&v=1&f=sd", - "duration": 27, - "hls_url": "https://v.redd.it/jq229anzada51/HLSPlaylist.m3u8?a=1597142191%2CYmY1Y2Q5ZjQ0ZWVmODAxODQ3MGU3YzA1YzIxOTEzODFlNWQyMjE4MzAyYzNiMDM5NTI0N2M5OTRmY2YwN2NlOA%3D%3D&v=1&f=sd", - "is_gif": False, - "transcoding_status": "completed", - } - }, - "is_video": True, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "Python", - "selftext": "", - "author_fullname": "t2_1kjpn251", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Concept Art: what might python look like in Japanese, without any English characters?", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/Python", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "discussion", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hp7uqe", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.94, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 1697, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Discussion", - "can_mod_post": False, - "score": 1697, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "crosspost_parent_list": [ - { - "approved_at_utc": None, - "subreddit": "ProgrammingLanguages", - "selftext": "", - "author_fullname": "t2_f4rdtgk", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Concept Art: what might python look like in Japanese, without any English characters?", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/ProgrammingLanguages", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_g9iu8x", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.96, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 440, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Discussion", - "can_mod_post": False, - "score": 440, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1588088407, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/ulc23n21jiv41.png", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "93811e06-0da7-11e8-a9a2-0e1129ea8e52", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qi8m", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "g9iu8x", - "is_robot_indexable": True, - "report_reasons": None, - "author": "MartialArtTetherball", - "discussion_type": None, - "num_comments": 65, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/ProgrammingLanguages/comments/g9iu8x/concept_art_what_might_python_look_like_in/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/ulc23n21jiv41.png", - "subreddit_subscribers": 43859, - "created_utc": 1588059607, - "num_crossposts": 2, - "media": None, - "is_video": False, - } - ], - "created": 1594492194, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/ulc23n21jiv41.png", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "0df42996-1c5e-11ea-b1a0-0e44e1c5b731", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh0y", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hp7uqe", - "is_robot_indexable": True, - "report_reasons": None, - "author": "SubstantialRange", - "discussion_type": None, - "num_comments": 182, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_g9iu8x", - "author_flair_text_color": None, - "permalink": "/r/Python/comments/hp7uqe/concept_art_what_might_python_look_like_in/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/ulc23n21jiv41.png", - "subreddit_subscribers": 616297, - "created_utc": 1594463394, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hozdzo", - "before": None, - }, -} - -empty_mock = { - "kind": "Listing", - "data": { - "modhash": "y4he8gfzh9f892e2bf3094bc06daba2e02288e617fecf555b5", - "dist": 27, - "children": [], - "after": "t3_hozdzo", - "before": None, - }, -} diff --git a/src/newsreader/news/collection/tests/reddit/collector/tests.py b/src/newsreader/news/collection/tests/reddit/collector/tests.py deleted file mode 100644 index c65020d..0000000 --- a/src/newsreader/news/collection/tests/reddit/collector/tests.py +++ /dev/null @@ -1,201 +0,0 @@ -from datetime import datetime, timezone -from unittest.mock import patch -from uuid import uuid4 - -from django.test import TestCase - -from newsreader.news.collection.choices import RuleTypeChoices -from newsreader.news.collection.exceptions import ( - StreamDeniedException, - StreamForbiddenException, - StreamNotFoundException, - StreamTimeOutException, -) -from newsreader.news.collection.reddit import RedditCollector -from newsreader.news.collection.tests.factories import SubredditFactory -from newsreader.news.collection.tests.reddit.collector.mocks import ( - empty_mock, - simple_mock_1, - simple_mock_2, -) -from newsreader.news.core.models import Post - - -class RedditCollectorTestCase(TestCase): - def setUp(self): - self.maxDiff = None - - self.patched_get = patch("newsreader.news.collection.reddit.fetch") - self.mocked_fetch = self.patched_get.start() - - self.patched_parse = patch( - "newsreader.news.collection.reddit.RedditStream.parse" - ) - self.mocked_parse = self.patched_parse.start() - - def tearDown(self): - patch.stopall() - - def test_simple_batch(self): - self.mocked_parse.side_effect = (simple_mock_1, simple_mock_2) - - rules = ( - (subreddit,) - for subreddit in SubredditFactory.create_batch( - user__reddit_access_token=str(uuid4()), - user__reddit_refresh_token=str(uuid4()), - enabled=True, - size=2, - ) - ) - - collector = RedditCollector() - collector.collect(rules=rules) - - self.assertCountEqual( - Post.objects.values_list("remote_identifier", flat=True), - ( - "hm6byg", - "hpkhgj", - "hph00n", - "hp9mlw", - "hpjn8x", - "gdfaip", - "hmd2ez", - "hpr28u", - "hpps6f", - "hp7uqe", - ), - ) - - for subreddit in rules: - with self.subTest(subreddit=subreddit): - self.assertEqual(subreddit.succeeded, True) - self.assertEqual(subreddit.last_run, datetime.now(tz=timezone.utc)) - self.assertEqual(subreddit.error, None) - - post = Post.objects.get( - remote_identifier="hph00n", rule__type=RuleTypeChoices.subreddit - ) - - self.assertEqual( - post.publication_date, - datetime(2020, 7, 11, 22, 23, 24, tzinfo=timezone.utc), - ) - - self.assertEqual(post.author, "HannahB888") - self.assertEqual(post.title, "Drake Interplanetary Smartkey thing that I made!") - self.assertEqual( - post.url, - "https://www.reddit.com/r/starcitizen/comments/hph00n/drake_interplanetary_smartkey_thing_that_i_made/", - ) - - post = Post.objects.get( - remote_identifier="hpr28u", rule__type=RuleTypeChoices.subreddit - ) - - self.assertEqual( - post.publication_date, - datetime(2020, 7, 12, 10, 29, 10, tzinfo=timezone.utc), - ) - - self.assertEqual(post.author, "Sebaron") - self.assertEqual( - post.title, - "I am a medical student, and I recently programmed an open-source eye-tracker for brain research", - ) - self.assertEqual( - post.url, - "https://www.reddit.com/r/Python/comments/hpr28u/i_am_a_medical_student_and_i_recently_programmed/", - ) - - def test_empty_batch(self): - self.mocked_parse.side_effect = (empty_mock, empty_mock) - - rules = ( - (subreddit,) - for subreddit in SubredditFactory.create_batch( - user__reddit_access_token=str(uuid4()), - user__reddit_refresh_token=str(uuid4()), - enabled=True, - size=2, - ) - ) - - collector = RedditCollector() - collector.collect(rules=rules) - - self.assertEqual(Post.objects.count(), 0) - - for subreddit in rules: - with self.subTest(subreddit=subreddit): - self.assertEqual(subreddit.succeeded, True) - self.assertEqual(subreddit.last_run, datetime.now(tz=timezone.utc)) - self.assertEqual(subreddit.error, None) - - def test_not_found(self): - self.mocked_fetch.side_effect = StreamNotFoundException - - rule = SubredditFactory( - user__reddit_access_token=str(uuid4()), - user__reddit_refresh_token=str(uuid4()), - enabled=True, - ) - - collector = RedditCollector() - collector.collect(rules=((rule,),)) - - self.assertEqual(Post.objects.count(), 0) - self.assertEqual(rule.succeeded, False) - self.assertEqual(rule.error, "Stream not found") - - @patch("newsreader.news.collection.reddit.RedditTokenTask") - def test_denied(self, mocked_task): - self.mocked_fetch.side_effect = StreamDeniedException - - rule = SubredditFactory( - user__reddit_access_token=str(uuid4()), - user__reddit_refresh_token=str(uuid4()), - enabled=True, - ) - - collector = RedditCollector() - collector.collect(rules=((rule,),)) - - self.assertEqual(Post.objects.count(), 0) - self.assertEqual(rule.succeeded, False) - self.assertEqual(rule.error, "Stream does not have sufficient permissions") - - mocked_task.delay.assert_called_once_with(rule.user.pk) - - def test_forbidden(self): - self.mocked_fetch.side_effect = StreamForbiddenException - - rule = SubredditFactory( - user__reddit_access_token=str(uuid4()), - user__reddit_refresh_token=str(uuid4()), - enabled=True, - ) - - collector = RedditCollector() - collector.collect(rules=((rule,),)) - - self.assertEqual(Post.objects.count(), 0) - self.assertEqual(rule.succeeded, False) - self.assertEqual(rule.error, "Stream forbidden") - - def test_timed_out(self): - self.mocked_fetch.side_effect = StreamTimeOutException - - rule = SubredditFactory( - user__reddit_access_token=str(uuid4()), - user__reddit_refresh_token=str(uuid4()), - enabled=True, - ) - - collector = RedditCollector() - collector.collect(rules=((rule,),)) - - self.assertEqual(Post.objects.count(), 0) - self.assertEqual(rule.succeeded, False) - self.assertEqual(rule.error, "Stream timed out") diff --git a/src/newsreader/news/collection/tests/reddit/stream/__init__.py b/src/newsreader/news/collection/tests/reddit/stream/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/newsreader/news/collection/tests/reddit/stream/mocks.py b/src/newsreader/news/collection/tests/reddit/stream/mocks.py deleted file mode 100644 index 148b31a..0000000 --- a/src/newsreader/news/collection/tests/reddit/stream/mocks.py +++ /dev/null @@ -1,3289 +0,0 @@ -simple_mock = { - "kind": "Listing", - "data": { - "modhash": "sgq4fdizx94db5c05b57f9957a4b8b2d5e24b712f5a507cffd", - "dist": 27, - "children": [ - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.\n\nLet us know what's annoying you, whats making you happy, or something that you want to get out to r/linux but didn't make the cut into a full post of it's own.\n\nFor those looking for certifications please use this megathread to ask about how to get certified whether it's for the business world or for your own satisfaction. Be sure to check out r/linuxadmin for more discussion in the SysAdmin world!\n\n_Please keep questions in r/linuxquestions, r/linux4noobs, or the Wednesday automod thread._", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Experiences/Rants or Education/Certifications thread - July 06, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hm0qct", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.65, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 6, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 6, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594037482.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a> rants and experiences! This megathread is also to hear opinions from anyone just starting out with Linux or those that have used Linux (GNU or otherwise) for a long time.</p>\n\n<p>Let us know what&#39;s annoying you, whats making you happy, or something that you want to get out to <a href="/r/linux">r/linux</a> but didn&#39;t make the cut into a full post of it&#39;s own.</p>\n\n<p>For those looking for certifications please use this megathread to ask about how to get certified whether it&#39;s for the business world or for your own satisfaction. Be sure to check out <a href="/r/linuxadmin">r/linuxadmin</a> for more discussion in the SysAdmin world!</p>\n\n<p><em>Please keep questions in <a href="/r/linuxquestions">r/linuxquestions</a>, <a href="/r/linux4noobs">r/linux4noobs</a>, or the Wednesday automod thread.</em></p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hm0qct", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 8, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hm0qct/linux_experiencesrants_or_educationcertifications/", - "subreddit_subscribers": 543995, - "created_utc": 1594008682.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Welcome to r/linux! If you're new to Linux or trying to get started this thread is for you. Get help here or as always, check out r/linuxquestions or r/linux4noobs\n\nThis megathread is for all your question needs. As we don't allow questions on r/linux outside of this megathread, please consider using r/linuxquestions or r/linux4noobs for the best solution to your problem.\n\nAsk your hardware requests here too or try r/linuxhardware!", - "author_fullname": "t2_6l4z3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Weekly Questions and Hardware Thread - July 08, 2020", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hna75r", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.5, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 0, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 0, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594210138.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Welcome to <a href="/r/linux">r/linux</a>! If you&#39;re new to Linux or trying to get started this thread is for you. Get help here or as always, check out <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a></p>\n\n<p>This megathread is for all your question needs. As we don&#39;t allow questions on <a href="/r/linux">r/linux</a> outside of this megathread, please consider using <a href="/r/linuxquestions">r/linuxquestions</a> or <a href="/r/linux4noobs">r/linux4noobs</a> for the best solution to your problem.</p>\n\n<p>Ask your hardware requests here too or try <a href="/r/linuxhardware">r/linuxhardware</a>!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": "new", - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": "moderator", - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hna75r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "AutoModerator", - "discussion_type": None, - "num_comments": 2, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "parent_whitelist_status": "all_ads", - "stickied": True, - "url": "https://www.reddit.com/r/linux/comments/hna75r/weekly_questions_and_hardware_thread_july_08_2020/", - "subreddit_subscribers": 543995, - "created_utc": 1594181338.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_gr7k5", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Here's a feature Linux could borrow from BSD: in-kernel debugger with built-in hangman game", - "link_flair_richtext": [{"e": "text", "t": "Fluff"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hngs71", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.9, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 135, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Fluff", - "can_mod_post": False, - "score": 135, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594242629.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/wmc8tp2ium951.jpg", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "af8918be-6777-11e7-8273-0e925d908786", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#9a2bff", - "id": "hngs71", - "is_robot_indexable": True, - "report_reasons": None, - "author": "the_humeister", - "discussion_type": None, - "num_comments": 20, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hngs71/heres_a_feature_linux_could_borrow_from_bsd/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/wmc8tp2ium951.jpg", - "subreddit_subscribers": 543995, - "created_utc": 1594213829.0, - "num_crossposts": 1, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_k9f35", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "KeePassXC 2.6.0 released", - "link_flair_richtext": [{"e": "text", "t": "Software Release"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hngsj8", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.97, - "author_flair_background_color": "transparent", - "subreddit_type": "public", - "ups": 126, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": "fa602e36-cdf6-11e8-93c9-0e41ac35f4cc", - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Software Release", - "can_mod_post": False, - "score": 126, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [ - { - "a": ":ubuntu:", - "e": "emoji", - "u": "https://emoji.redditmedia.com/uwmddx7qqpr11_t5_2qh1a/ubuntu", - } - ], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594242666.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "keepassxc.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://keepassxc.org/blog/2020-07-07-2.6.0-released/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "904ea3e4-6748-11e7-b925-0ef3dfbb807a", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": ":ubuntu:", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#349e48", - "id": "hngsj8", - "is_robot_indexable": True, - "report_reasons": None, - "author": "nixcraft", - "discussion_type": None, - "num_comments": 42, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/linux/comments/hngsj8/keepassxc_260_released/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://keepassxc.org/blog/2020-07-07-2.6.0-released/", - "subreddit_subscribers": 543995, - "created_utc": 1594213866.0, - "num_crossposts": 1, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [{"e": "text", "t": "Popular Application"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd7cy", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.95, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 223, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Popular Application", - "can_mod_post": False, - "score": 223, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "crosspost_parent_list": [ - { - "approved_at_utc": None, - "subreddit": "libreoffice", - "selftext": "", - "author_fullname": "t2_hlv0o", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": 'Board statement on the LibreOffice 7.0 RC "Personal Edition" label', - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/libreoffice", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnd6yo", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.94, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 28, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "News", - "can_mod_post": False, - "score": 28, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594224961.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "dc82ac98-bafb-11e4-9f88-22000b310327", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2s4nt", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnd6yo", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZero", - "discussion_type": None, - "num_comments": 38, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/libreoffice/comments/hnd6yo/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 4669, - "created_utc": 1594196161.0, - "num_crossposts": 2, - "media": None, - "is_video": False, - } - ], - "created": 1594225018.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.documentfoundation.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "7127ec98-5859-11e8-9488-0e8717893ec8", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#0aa18f", - "id": "hnd7cy", - "is_robot_indexable": True, - "report_reasons": None, - "author": "TheQuantumZero", - "discussion_type": None, - "num_comments": 109, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_hnd6yo", - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnd7cy/board_statement_on_the_libreoffice_70_rc_personal/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.documentfoundation.org/blog/2020/07/06/board-statement-on-the-libreoffice-7-0rc-personal-edition-label/", - "subreddit_subscribers": 543995, - "created_utc": 1594196218.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_6cxnzaq2", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Gentoo Now on Android Platform !!!", - "link_flair_richtext": [{"e": "text", "t": "Mobile Linux"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnemei", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.87, - "author_flair_background_color": "transparent", - "subreddit_type": "public", - "ups": 78, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": "a54a7460-cdf6-11e8-b31c-0e89679a2148", - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Mobile Linux", - "can_mod_post": False, - "score": 78, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [ - { - "a": ":arch:", - "e": "emoji", - "u": "https://emoji.redditmedia.com/tip79drnqpr11_t5_2qh1a/arch", - } - ], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594232773.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "gentoo.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://www.gentoo.org/news/2020/07/07/gentoo-android.html", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "84162644-5859-11e8-b9ed-0efda312d094", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": ":arch:", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#d78216", - "id": "hnemei", - "is_robot_indexable": True, - "report_reasons": None, - "author": "draplon", - "discussion_type": None, - "num_comments": 21, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/linux/comments/hnemei/gentoo_now_on_android_platform/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.gentoo.org/news/2020/07/07/gentoo-android.html", - "subreddit_subscribers": 543995, - "created_utc": 1594203973.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_f9vxe", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Google is teaming up with Ubuntu to bring Flutter apps to Linux", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hniojf", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.77, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 31, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 31, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594249580.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "androidpolice.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://www.androidpolice.com/2020/07/08/google-is-teaming-up-with-ubuntu-to-bring-flutter-apps-to-linux/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hniojf", - "is_robot_indexable": True, - "report_reasons": None, - "author": "bilal4hmed", - "discussion_type": None, - "num_comments": 24, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hniojf/google_is_teaming_up_with_ubuntu_to_bring_flutter/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.androidpolice.com/2020/07/08/google-is-teaming-up-with-ubuntu-to-bring-flutter-apps-to-linux/", - "subreddit_subscribers": 543995, - "created_utc": 1594220780.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_k9f35", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Ariane RISC-V CPU \u2013 An open source CPU capable of booting Linux", - "link_flair_richtext": [{"e": "text", "t": "Hardware"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hngr1j", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.89, - "author_flair_background_color": "transparent", - "subreddit_type": "public", - "ups": 49, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": "fa602e36-cdf6-11e8-93c9-0e41ac35f4cc", - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Hardware", - "can_mod_post": False, - "score": 49, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [ - { - "a": ":ubuntu:", - "e": "emoji", - "u": "https://emoji.redditmedia.com/uwmddx7qqpr11_t5_2qh1a/ubuntu", - } - ], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594242511.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "github.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://github.com/openhwgroup/cva6", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "3d48793a-c823-11e8-9a58-0ee3c97eb952", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": ":ubuntu:", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#cc5289", - "id": "hngr1j", - "is_robot_indexable": True, - "report_reasons": None, - "author": "nixcraft", - "discussion_type": None, - "num_comments": 15, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/linux/comments/hngr1j/ariane_riscv_cpu_an_open_source_cpu_capable_of/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://github.com/openhwgroup/cva6", - "subreddit_subscribers": 543995, - "created_utc": 1594213711.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_6kt9ukjs", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Canonical enables Linux desktop app support with Flutter", - "link_flair_richtext": [{"e": "text", "t": "Software Release"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnj1ap", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.79, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 24, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Software Release", - "can_mod_post": False, - "score": 24, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594250752.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "ubuntu.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://ubuntu.com/blog/canonical-enables-linux-desktop-app-support-with-flutter", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "904ea3e4-6748-11e7-b925-0ef3dfbb807a", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#349e48", - "id": "hnj1ap", - "is_robot_indexable": True, - "report_reasons": None, - "author": "hmblhstl", - "discussion_type": None, - "num_comments": 28, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnj1ap/canonical_enables_linux_desktop_app_support_with/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://ubuntu.com/blog/canonical-enables-linux-desktop-app-support-with-flutter", - "subreddit_subscribers": 543995, - "created_utc": 1594221952.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_3vf8x", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Sandboxing in Linux with zero lines of code", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnfzbm", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.83, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 30, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 30, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594239285.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "blog.cloudflare.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://blog.cloudflare.com/sandboxing-in-linux-with-zero-lines-of-code/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnfzbm", - "is_robot_indexable": True, - "report_reasons": None, - "author": "pimterry", - "discussion_type": None, - "num_comments": 0, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnfzbm/sandboxing_in_linux_with_zero_lines_of_code/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://blog.cloudflare.com/sandboxing-in-linux-with-zero-lines-of-code/", - "subreddit_subscribers": 543995, - "created_utc": 1594210485.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_318in", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "SUSE Enters Into Definitive Agreement to Acquire Rancher Labs", - "link_flair_richtext": [ - {"e": "text", "t": "Open Source Organization"} - ], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnh5ux", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.84, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 26, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Open Source Organization", - "can_mod_post": False, - "score": 26, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594244123.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "rancher.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://rancher.com/blog/2020/suse-to-acquire-rancher/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "8a1dd4b0-5859-11e8-a2c7-0e5ebdbe24d6", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#800000", - "id": "hnh5ux", - "is_robot_indexable": True, - "report_reasons": None, - "author": "hjames9", - "discussion_type": None, - "num_comments": 5, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnh5ux/suse_enters_into_definitive_agreement_to_acquire/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://rancher.com/blog/2020/suse-to-acquire-rancher/", - "subreddit_subscribers": 543995, - "created_utc": 1594215323.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_j1a5", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Mint drops Ubuntu Snap packages [LWN.net]", - "link_flair_richtext": [{"e": "text", "t": "Distro News"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": True, - "name": "t3_hnlt4l", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.8, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 9, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Distro News", - "can_mod_post": False, - "score": 9, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594259641.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "lwn.net", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://lwn.net/SubscriberLink/825005/6440c82feb745bbe/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "6888e772-5859-11e8-82ff-0e816ab71260", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#0dd3bb", - "id": "hnlt4l", - "is_robot_indexable": True, - "report_reasons": None, - "author": "tapo", - "discussion_type": None, - "num_comments": 3, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnlt4l/linux_mint_drops_ubuntu_snap_packages_lwnnet/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://lwn.net/SubscriberLink/825005/6440c82feb745bbe/", - "subreddit_subscribers": 543995, - "created_utc": 1594230841.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_4i3yk", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Announcing Flutter Linux Alpha with Canonical", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hniq04", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.6, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 6, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 6, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594249712.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "medium.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://medium.com/flutter/announcing-flutter-linux-alpha-with-canonical-19eb824590a9", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hniq04", - "is_robot_indexable": True, - "report_reasons": None, - "author": "popeydc", - "discussion_type": None, - "num_comments": 3, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hniq04/announcing_flutter_linux_alpha_with_canonical/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://medium.com/flutter/announcing-flutter-linux-alpha-with-canonical-19eb824590a9", - "subreddit_subscribers": 543995, - "created_utc": 1594220912.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_611c0ard", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "New anti-encryption bill worse than EARN IT, would force a backdoor into any US device/software. Act now to stop both.", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hmp66i", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.98, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 3340, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 3340, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594131589.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "tutanota.com", - "allow_live_comments": True, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://tutanota.com/blog/posts/lawful-access-encrypted-data-act-backdoor", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hmp66i", - "is_robot_indexable": True, - "report_reasons": None, - "author": "fossfans", - "discussion_type": None, - "num_comments": 380, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hmp66i/new_antiencryption_bill_worse_than_earn_it_would/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://tutanota.com/blog/posts/lawful-access-encrypted-data-act-backdoor", - "subreddit_subscribers": 543995, - "created_utc": 1594102789.0, - "num_crossposts": 2, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "We have had Freesync \"support\" for quite some time now, but it is extremely restrictive and very picky to get it working. Just the requirements to have Freesync working is no-go for many:\n\n\\-> Single monitor only;\n\n\\-> No video playback or turning it on while on desktop;\n\n\\-> Should only be turned on only while the game/software in question is in fullscreen;\n\n\\-> X11, no Wayland;\n\n\\-> Only tested/working distro is Ubuntu 16.04.3;\n\n\\-> Need of setting it up through some quite cryptic commands;\n\n\\-> Doesn't work after hotplug or system restart;\n\n\\-> No Freesync over HDMI (which isn't a massive problem, but a nice option to have);\n\n\\-> Apparently only OpenGL, no Vulkan (Steam Play/Proton, which is the main purpose for Freesync at the moment, doesn't work);\n\n&#x200B;\n\nI am not really complaining, because I do know that Freesync is hard to get working on Linux, but we have had so many advancements on the gaming side of Linux, and we are still stuck with all of these restrictions to use Freesync, which is quite a useful functionality for almost every gamer. If Mozilla got video decoding working well on Wayland, I hope (Idk anything about this, just hoping) that it could also be easy to implement Freesync on Wayland too.\n\nWe just haven't had that many improvements on this side of the Linux gaming world, and I'd like to know if it is lack of support/interest by AMD, or if it actually is extremely hard to implement it on Linux. Freesync would also be very useful for those who are running monitors over 60Hz, so that those 60FPS videos don't look as weird as they do while playing back on higher refresh rate monitors. It is just a nice thing for everybody, really!", - "author_fullname": "t2_1afv9v8g", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Any evolution on the Freesync situation on Linux?", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hn7agp", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.85, - "author_flair_background_color": "transparent", - "subreddit_type": "public", - "ups": 83, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": "fa602e36-cdf6-11e8-93c9-0e41ac35f4cc", - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 83, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [ - { - "a": ":ubuntu:", - "e": "emoji", - "u": "https://emoji.redditmedia.com/uwmddx7qqpr11_t5_2qh1a/ubuntu", - } - ], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594199056.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>We have had Freesync &quot;support&quot; for quite some time now, but it is extremely restrictive and very picky to get it working. Just the requirements to have Freesync working is no-go for many:</p>\n\n<p>-&gt; Single monitor only;</p>\n\n<p>-&gt; No video playback or turning it on while on desktop;</p>\n\n<p>-&gt; Should only be turned on only while the game/software in question is in fullscreen;</p>\n\n<p>-&gt; X11, no Wayland;</p>\n\n<p>-&gt; Only tested/working distro is Ubuntu 16.04.3;</p>\n\n<p>-&gt; Need of setting it up through some quite cryptic commands;</p>\n\n<p>-&gt; Doesn&#39;t work after hotplug or system restart;</p>\n\n<p>-&gt; No Freesync over HDMI (which isn&#39;t a massive problem, but a nice option to have);</p>\n\n<p>-&gt; Apparently only OpenGL, no Vulkan (Steam Play/Proton, which is the main purpose for Freesync at the moment, doesn&#39;t work);</p>\n\n<p>&#x200B;</p>\n\n<p>I am not really complaining, because I do know that Freesync is hard to get working on Linux, but we have had so many advancements on the gaming side of Linux, and we are still stuck with all of these restrictions to use Freesync, which is quite a useful functionality for almost every gamer. If Mozilla got video decoding working well on Wayland, I hope (Idk anything about this, just hoping) that it could also be easy to implement Freesync on Wayland too.</p>\n\n<p>We just haven&#39;t had that many improvements on this side of the Linux gaming world, and I&#39;d like to know if it is lack of support/interest by AMD, or if it actually is extremely hard to implement it on Linux. Freesync would also be very useful for those who are running monitors over 60Hz, so that those 60FPS videos don&#39;t look as weird as they do while playing back on higher refresh rate monitors. It is just a nice thing for everybody, really!</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": ":ubuntu:", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hn7agp", - "is_robot_indexable": True, - "report_reasons": None, - "author": "mreich98", - "discussion_type": None, - "num_comments": 36, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/linux/comments/hn7agp/any_evolution_on_the_freesync_situation_on_linux/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.reddit.com/r/linux/comments/hn7agp/any_evolution_on_the_freesync_situation_on_linux/", - "subreddit_subscribers": 543995, - "created_utc": 1594170256.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_7ccf", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Running Rosetta@home on a Raspberry Pi with Fedora IoT", - "link_flair_richtext": [{"e": "text", "t": "Popular Application"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnfw0h", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.73, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 8, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Popular Application", - "can_mod_post": False, - "score": 8, - "approved_by": None, - "author_premium": True, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594238884.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "fedoramagazine.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://fedoramagazine.org/running-rosettahome-on-a-raspberry-pi-with-fedora-iot/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "7127ec98-5859-11e8-9488-0e8717893ec8", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#0aa18f", - "id": "hnfw0h", - "is_robot_indexable": True, - "report_reasons": None, - "author": "speckz", - "discussion_type": None, - "num_comments": 1, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnfw0h/running_rosettahome_on_a_raspberry_pi_with_fedora/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://fedoramagazine.org/running-rosettahome-on-a-raspberry-pi-with-fedora-iot/", - "subreddit_subscribers": 543995, - "created_utc": 1594210084.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_sx11s", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Getting Things GNOME 0.4 released! First release in almost 7 years (Flatpak available).", - "link_flair_richtext": [{"e": "text", "t": "Software Release"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hn5wh6", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.79, - "author_flair_background_color": "transparent", - "subreddit_type": "public", - "ups": 58, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": "2194c338-ce1d-11e8-8ed7-0e20bb1bbc52", - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Software Release", - "can_mod_post": False, - "score": 58, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [ - { - "a": ":nix:", - "e": "emoji", - "u": "https://emoji.redditmedia.com/ww1ubcjpqpr11_t5_2qh1a/nix", - } - ], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594193982.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "flathub.org", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://flathub.org/apps/details/org.gnome.GTG", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "904ea3e4-6748-11e7-b925-0ef3dfbb807a", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": ":nix:", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#349e48", - "id": "hn5wh6", - "is_robot_indexable": True, - "report_reasons": None, - "author": "Kanarme", - "discussion_type": None, - "num_comments": 22, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/linux/comments/hn5wh6/getting_things_gnome_04_released_first_release_in/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://flathub.org/apps/details/org.gnome.GTG", - "subreddit_subscribers": 543995, - "created_utc": 1594165182.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_636xx258", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "mpv is not anymore supporting gnome. and the owner reverted the commit again shortly after and then again made a new one, to add the changes", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": True, - "name": "t3_hnnt0v", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 1.0, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 1, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 1, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "crosspost_parent_list": [ - { - "approved_at_utc": None, - "subreddit": "gnome", - "selftext": "", - "author_fullname": "t2_33wgs4m3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "mpv is not anymore supporting gnome. and the owner reverted the commit again shortly after and then again made a new one, to add the changes", - "link_flair_richtext": [{"e": "text", "t": "News"}], - "subreddit_name_prefixed": "r/gnome", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hn1s3r", - "quarantine": False, - "link_flair_text_color": "light", - "upvote_ratio": 0.81, - "author_flair_background_color": "transparent", - "subreddit_type": "public", - "ups": 23, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": "1515012e-bed8-11ea-92a7-0eb4e155a177", - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "News", - "can_mod_post": False, - "score": 23, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": "gnome-user", - "author_flair_richtext": [{"e": "text", "t": "GNOMie"}], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594180508.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "richtext", - "domain": "github.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": "confidence", - "banned_at_utc": None, - "url_overridden_by_dest": "https://github.com/mpv-player/mpv/commit/cdaa496314f90412963f2b3211e18df72910066d#commitcomment-40434556", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "7dbe0c80-f9df-11e8-b35e-0e2ae22a2534", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": "GNOMie", - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qjhn", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#692c52", - "id": "hn1s3r", - "is_robot_indexable": True, - "report_reasons": None, - "author": "idiot10000000", - "discussion_type": None, - "num_comments": 53, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": "dark", - "permalink": "/r/gnome/comments/hn1s3r/mpv_is_not_anymore_supporting_gnome_and_the_owner/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://github.com/mpv-player/mpv/commit/cdaa496314f90412963f2b3211e18df72910066d#commitcomment-40434556", - "subreddit_subscribers": 41350, - "created_utc": 1594151708.0, - "num_crossposts": 1, - "media": None, - "is_video": False, - } - ], - "created": 1594265700.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "github.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://github.com/mpv-player/mpv/commit/cdaa496314f90412963f2b3211e18df72910066d#commitcomment-40434556", - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnnt0v", - "is_robot_indexable": True, - "report_reasons": None, - "author": "RetartedTortoise", - "discussion_type": None, - "num_comments": 0, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_hn1s3r", - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnnt0v/mpv_is_not_anymore_supporting_gnome_and_the_owner/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://github.com/mpv-player/mpv/commit/cdaa496314f90412963f2b3211e18df72910066d#commitcomment-40434556", - "subreddit_subscribers": 543995, - "created_utc": 1594236900.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_21omsw7y", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Google and Canonical bring Linux apps support to Flutter - 9to5Google", - "link_flair_richtext": [{"e": "text", "t": "Development"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnj42j", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.59, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 3, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Development", - "can_mod_post": False, - "score": 3, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594251002.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "9to5google.com", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://9to5google.com/2020/07/08/google-canonical-partnership-linux-flutter-apps/", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "3cb511e2-7914-11ea-bb33-0ee30ee9d22b", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#f0db8a", - "id": "hnj42j", - "is_robot_indexable": True, - "report_reasons": None, - "author": "satvikpendem", - "discussion_type": None, - "num_comments": 1, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnj42j/google_and_canonical_bring_linux_apps_support_to/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://9to5google.com/2020/07/08/google-canonical-partnership-linux-flutter-apps/", - "subreddit_subscribers": 543995, - "created_utc": 1594222202.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": " As far as I understand it, the current options on the Intel Iris/NVIDIA side are:\n\n* Intel or NVIDIA cards only\n\n* Optimus for switching between Intel and Intel+NVIDIA (requires reboot)\n\n* Bumblebee for on-the-fly switching with a performance hit\n\n* nvidia-xrun, which does everything bumblebee can do but requires a second X server\n\n* Prime Rener Offload, a proprietary NVIDIA thing, for switching between Intel and Intel+NVIDIA, which I don't completely understand\n\nDo I have this right? And how do things look on the Amd Vega/Radeon configuration?", - "author_fullname": "t2_tcnt4", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "[Discussion] What's the current status on laptop switchable graphics?", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": True, - "name": "t3_hnmiik", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.67, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 1, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 1, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594261813.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>As far as I understand it, the current options on the Intel Iris/NVIDIA side are:</p>\n\n<ul>\n<li><p>Intel or NVIDIA cards only</p></li>\n<li><p>Optimus for switching between Intel and Intel+NVIDIA (requires reboot)</p></li>\n<li><p>Bumblebee for on-the-fly switching with a performance hit</p></li>\n<li><p>nvidia-xrun, which does everything bumblebee can do but requires a second X server</p></li>\n<li><p>Prime Rener Offload, a proprietary NVIDIA thing, for switching between Intel and Intel+NVIDIA, which I don&#39;t completely understand</p></li>\n</ul>\n\n<p>Do I have this right? And how do things look on the Amd Vega/Radeon configuration?</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnmiik", - "is_robot_indexable": True, - "report_reasons": None, - "author": "KoolDude214", - "discussion_type": None, - "num_comments": 4, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnmiik/discussion_whats_the_current_status_on_laptop/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.reddit.com/r/linux/comments/hnmiik/discussion_whats_the_current_status_on_laptop/", - "subreddit_subscribers": 543995, - "created_utc": 1594233013.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Hello all!\n\nI've created this simple web app as a part of learning web development, to help people select a linux distro for themselves.\n\nIt's a really simple web app, as I've created it as part of learning web development.\n\nIt retrieves data from another API that I've defined and this very API's database is used to store all the releated information that only right now I can store.\n\nAnd this web app is used to get information from that API and display it in an organized way.\n\nHave a look and please let me know about your thoughts and suggestions:\n\nLink: [https://linux-distros-encyclopedia.herokuapp.com/](https://linux-distros-encyclopedia.herokuapp.com/)", - "author_fullname": "t2_4c9tcvx3", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Distributions Encyclopedia Web App", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnlh54", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.5, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 0, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 0, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594258586.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Hello all!</p>\n\n<p>I&#39;ve created this simple web app as a part of learning web development, to help people select a linux distro for themselves.</p>\n\n<p>It&#39;s a really simple web app, as I&#39;ve created it as part of learning web development.</p>\n\n<p>It retrieves data from another API that I&#39;ve defined and this very API&#39;s database is used to store all the releated information that only right now I can store.</p>\n\n<p>And this web app is used to get information from that API and display it in an organized way.</p>\n\n<p>Have a look and please let me know about your thoughts and suggestions:</p>\n\n<p>Link: <a href="https://linux-distros-encyclopedia.herokuapp.com/">https://linux-distros-encyclopedia.herokuapp.com/</a></p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnlh54", - "is_robot_indexable": True, - "report_reasons": None, - "author": "MisterKhJe", - "discussion_type": None, - "num_comments": 2, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnlh54/linux_distributions_encyclopedia_web_app/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.reddit.com/r/linux/comments/hnlh54/linux_distributions_encyclopedia_web_app/", - "subreddit_subscribers": 543995, - "created_utc": 1594229786.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "I would like to turn my old Asus tablet into an ultimate linux-based Ebook reader. It's currently running kali linux due to my netsec background and I can't say that it runs flawlessly. The tablet came with Windows 10 by default. Does anyone have the experience with what distro and pdf reader to use?\n\nIt has to be lightweight due to 1.3Ghz Atom processor and 1Gb of Ram.", - "author_fullname": "t2_y0rlp", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux based Ebook reader tablet", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hnecim", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.56, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 2, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594231304.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>I would like to turn my old Asus tablet into an ultimate linux-based Ebook reader. It&#39;s currently running kali linux due to my netsec background and I can&#39;t say that it runs flawlessly. The tablet came with Windows 10 by default. Does anyone have the experience with what distro and pdf reader to use?</p>\n\n<p>It has to be lightweight due to 1.3Ghz Atom processor and 1Gb of Ram.</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnecim", - "is_robot_indexable": True, - "report_reasons": None, - "author": "Kikur", - "discussion_type": None, - "num_comments": 5, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnecim/linux_based_ebook_reader_tablet/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.reddit.com/r/linux/comments/hnecim/linux_based_ebook_reader_tablet/", - "subreddit_subscribers": 543995, - "created_utc": 1594202504.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_300vb", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Backing up my work-provided Windows laptop with Debian, ZFS and SquashFS", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hn2ro8", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.74, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 23, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 23, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594183686.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "thanassis.space", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://www.thanassis.space/backupCOVID.html", - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hn2ro8", - "is_robot_indexable": True, - "report_reasons": None, - "author": "ttsiodras", - "discussion_type": None, - "num_comments": 5, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hn2ro8/backing_up_my_workprovided_windows_laptop_with/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.thanassis.space/backupCOVID.html", - "subreddit_subscribers": 543995, - "created_utc": 1594154886.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "", - "author_fullname": "t2_2ccbdhht", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Debian influences everywhere", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": True, - "name": "t3_hnndj2", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.36, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 0, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 0, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "crosspost_parent_list": [ - { - "approved_at_utc": None, - "subreddit": "ramen", - "selftext": "", - "author_fullname": "t2_1e5jztuf", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "My 1st Attempt for Tori Paitan", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/ramen", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": True, - "name": "t3_hnn89u", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 1.0, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 2, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": True, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Homemade", - "can_mod_post": False, - "score": 2, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": False, - "mod_note": None, - "created": 1594263979.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/ai9r2wu5mo951.jpg", - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "28b48e48-ce25-11e8-94f2-0e1ed223bf48", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qykd", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#ffd635", - "id": "hnn89u", - "is_robot_indexable": True, - "report_reasons": None, - "author": "cheesychicken80", - "discussion_type": None, - "num_comments": 1, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/ramen/comments/hnn89u/my_1st_attempt_for_tori_paitan/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/ai9r2wu5mo951.jpg", - "subreddit_subscribers": 257000, - "created_utc": 1594235179.0, - "num_crossposts": 1, - "media": None, - "is_video": False, - } - ], - "created": 1594264403.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "i.redd.it", - "allow_live_comments": False, - "selftext_html": None, - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "url_overridden_by_dest": "https://i.redd.it/ai9r2wu5mo951.jpg", - "view_count": None, - "archived": False, - "no_follow": True, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hnndj2", - "is_robot_indexable": True, - "report_reasons": None, - "author": "dracardOner", - "discussion_type": None, - "num_comments": 0, - "send_replies": False, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "crosspost_parent": "t3_hnn89u", - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hnndj2/debian_influences_everywhere/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://i.redd.it/ai9r2wu5mo951.jpg", - "subreddit_subscribers": 543995, - "created_utc": 1594235603.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "There is an open issue in Electron-Builder to add option to easily create flatpak repo. This results in many electron apps not officially/easily supporting flatpak, thus solving this would help flatpak adoption and make it easier for users to install their favourite apps. See the issue on github for more info [https://github.com/electron-userland/electron-builder/issues/512](https://github.com/electron-userland/electron-builder/issues/512)\n\nSince there are no technical obstacles that prevent completing this task, I made a small bounty on gitpay [https://gitpay.me/#/task/352](https://gitpay.me/#/task/352) to motivate developers, and if you care about this issue, consider chiming in too, spreading the word or even giving a try at implementing this :)", - "author_fullname": "t2_5hgjidqm", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Crowdsource Flatpak support in Electron-Builder", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hmytic", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.76, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 37, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 37, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594171301.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>There is an open issue in Electron-Builder to add option to easily create flatpak repo. This results in many electron apps not officially/easily supporting flatpak, thus solving this would help flatpak adoption and make it easier for users to install their favourite apps. See the issue on github for more info <a href="https://github.com/electron-userland/electron-builder/issues/512">https://github.com/electron-userland/electron-builder/issues/512</a></p>\n\n<p>Since there are no technical obstacles that prevent completing this task, I made a small bounty on gitpay <a href="https://gitpay.me/#/task/352">https://gitpay.me/#/task/352</a> to motivate developers, and if you care about this issue, consider chiming in too, spreading the word or even giving a try at implementing this :)</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hmytic", - "is_robot_indexable": True, - "report_reasons": None, - "author": "ignapk", - "discussion_type": None, - "num_comments": 23, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hmytic/crowdsource_flatpak_support_in_electronbuilder/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.reddit.com/r/linux/comments/hmytic/crowdsource_flatpak_support_in_electronbuilder/", - "subreddit_subscribers": 543995, - "created_utc": 1594142501.0, - "num_crossposts": 5, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "I was experiencing graphic issues and glitches in some games while using Linux Ubuntu 20.04 LTS with my Ryzen 3 3250u CPU and I wanted to share how I fixed this issue for anyone else with this same problem.\n\nFirst thing you should try is setting 'AMD_DEBUG=nodmacopyimage' as an environmental variable. This only partly fixed the issue for me as most of the in-game textures were still glitchy and messed up. However this method seemed to work for some other people https://gitlab.freedesktop.org/mesa/mesa/-/issues/2814\n\nThe second method I tried was downgrading from Ubuntu 20.04 to Ubuntu 19.10. This fixed my problem instantly and the glitchy in-game textures were no longer an issue.\n\n\nIm still new to Linux and not very tech savvy so I can't provide a detailed explanation of what causes this problem and why these methods seem to fix it however I'm pretty sure its something to do with the AMD graphics drivers. Hopefully this issue will be fixed in the next Ubuntu update\n\nHope this helped ;)", - "author_fullname": "t2_6qntnayu", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Linux Graphical Glitches on Ryzen CPUs", - "link_flair_richtext": [{"e": "text", "t": "Tips and Tricks"}], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": "", - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hmxiyt", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.79, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 20, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": "Tips and Tricks", - "can_mod_post": False, - "score": 20, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594167246.0, - "link_flair_type": "richtext", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>I was experiencing graphic issues and glitches in some games while using Linux Ubuntu 20.04 LTS with my Ryzen 3 3250u CPU and I wanted to share how I fixed this issue for anyone else with this same problem.</p>\n\n<p>First thing you should try is setting &#39;AMD_DEBUG=nodmacopyimage&#39; as an environmental variable. This only partly fixed the issue for me as most of the in-game textures were still glitchy and messed up. However this method seemed to work for some other people <a href="https://gitlab.freedesktop.org/mesa/mesa/-/issues/2814">https://gitlab.freedesktop.org/mesa/mesa/-/issues/2814</a></p>\n\n<p>The second method I tried was downgrading from Ubuntu 20.04 to Ubuntu 19.10. This fixed my problem instantly and the glitchy in-game textures were no longer an issue.</p>\n\n<p>Im still new to Linux and not very tech savvy so I can&#39;t provide a detailed explanation of what causes this problem and why these methods seem to fix it however I&#39;m pretty sure its something to do with the AMD graphics drivers. Hopefully this issue will be fixed in the next Ubuntu update</p>\n\n<p>Hope this helped ;)</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "link_flair_template_id": "de62f716-76df-11ea-802c-0e7469f68f6b", - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "#00a6a5", - "id": "hmxiyt", - "is_robot_indexable": True, - "report_reasons": None, - "author": "Inolicious_", - "discussion_type": None, - "num_comments": 9, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hmxiyt/linux_graphical_glitches_on_ryzen_cpus/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.reddit.com/r/linux/comments/hmxiyt/linux_graphical_glitches_on_ryzen_cpus/", - "subreddit_subscribers": 543995, - "created_utc": 1594138446.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - { - "kind": "t3", - "data": { - "approved_at_utc": None, - "subreddit": "linux", - "selftext": "Well, alright, at various points in my life I may have been more pleased, but Windows has been losing my support for years one small nitpick at a time. Just wanted to share the change for whoever cares.\n\n* I liked the look and massive size of the windows less and less \n* As a programmer using bash and zsh on cygwin became more and more annoying\n* Windows keeps randomly changing stuff that I never wanted, like my downloads folder becoming a date-sorted list instead of an actual folder (and switching it back when I changed it!)\n* Adding cortana and the like and making it difficult to disable\n* Windows update.\n* Almost every bit of software I have at this point is also on linux or through a browser!\n\nI switched to Manjaro-Gnome and never looked back.\n\n* It's sleeker/runs faster.\n* Uses less RAM\n* Uses rolling updates\n* I can finally just use a built-in terminal\n* Has an easier to understand file structure, despite its complexity.\n* Is surprisingly easy to use. The only difficult part really was finding the wifi driver, and that was actually because it was mislabeled by the manufacturer.\n* Gnome is definitely nicer to use than Windows 10.\n* Searching for files and programs works well! I really didn't need windows to fail to find a program I had installed and instead offer to search for it online... through Bing on Edge.\n\nI never knew how much bloat Windows had until I switched over. This is so damn nice. I don't know why I didn't consider Linux as a serious alternative until recently. Steam Proton has also come a long, long way, I haven't had issues with a game yet.\n\nAnyways, I just wanted to rant, and I'm probably going to install an Manjaro-xfce on a bunch of old laptops.", - "author_fullname": "t2_8zm4y", - "saved": False, - "mod_reason_title": None, - "gilded": 0, - "clicked": False, - "title": "Switched from Windows 10 to Manjaro, never been happier", - "link_flair_richtext": [], - "subreddit_name_prefixed": "r/linux", - "hidden": False, - "pwls": 6, - "link_flair_css_class": None, - "downs": 0, - "top_awarded_type": None, - "hide_score": False, - "name": "t3_hmgujt", - "quarantine": False, - "link_flair_text_color": "dark", - "upvote_ratio": 0.92, - "author_flair_background_color": None, - "subreddit_type": "public", - "ups": 598, - "total_awards_received": 0, - "media_embed": {}, - "author_flair_template_id": None, - "is_original_content": False, - "user_reports": [], - "secure_media": None, - "is_reddit_media_domain": False, - "is_meta": False, - "category": None, - "secure_media_embed": {}, - "link_flair_text": None, - "can_mod_post": False, - "score": 598, - "approved_by": None, - "author_premium": False, - "thumbnail": "", - "edited": False, - "author_flair_css_class": None, - "author_flair_richtext": [], - "gildings": {}, - "content_categories": None, - "is_self": True, - "mod_note": None, - "created": 1594099445.0, - "link_flair_type": "text", - "wls": 6, - "removed_by_category": None, - "banned_by": None, - "author_flair_type": "text", - "domain": "self.linux", - "allow_live_comments": False, - "selftext_html": '<!-- SC_OFF --><div class="md"><p>Well, alright, at various points in my life I may have been more pleased, but Windows has been losing my support for years one small nitpick at a time. Just wanted to share the change for whoever cares.</p>\n\n<ul>\n<li>I liked the look and massive size of the windows less and less </li>\n<li>As a programmer using bash and zsh on cygwin became more and more annoying</li>\n<li>Windows keeps randomly changing stuff that I never wanted, like my downloads folder becoming a date-sorted list instead of an actual folder (and switching it back when I changed it!)</li>\n<li>Adding cortana and the like and making it difficult to disable</li>\n<li>Windows update.</li>\n<li>Almost every bit of software I have at this point is also on linux or through a browser!</li>\n</ul>\n\n<p>I switched to Manjaro-Gnome and never looked back.</p>\n\n<ul>\n<li>It&#39;s sleeker/runs faster.</li>\n<li>Uses less RAM</li>\n<li>Uses rolling updates</li>\n<li>I can finally just use a built-in terminal</li>\n<li>Has an easier to understand file structure, despite its complexity.</li>\n<li>Is surprisingly easy to use. The only difficult part really was finding the wifi driver, and that was actually because it was mislabeled by the manufacturer.</li>\n<li>Gnome is definitely nicer to use than Windows 10.</li>\n<li>Searching for files and programs works well! I really didn&#39;t need windows to fail to find a program I had installed and instead offer to search for it online... through Bing on Edge.</li>\n</ul>\n\n<p>I never knew how much bloat Windows had until I switched over. This is so damn nice. I don&#39;t know why I didn&#39;t consider Linux as a serious alternative until recently. Steam Proton has also come a long, long way, I haven&#39;t had issues with a game yet.</p>\n\n<p>Anyways, I just wanted to rant, and I&#39;m probably going to install an Manjaro-xfce on a bunch of old laptops.</p>\n</div><!-- SC_ON -->', - "likes": None, - "suggested_sort": None, - "banned_at_utc": None, - "view_count": None, - "archived": False, - "no_follow": False, - "is_crosspostable": True, - "pinned": False, - "over_18": False, - "all_awardings": [], - "awarders": [], - "media_only": False, - "can_gild": True, - "spoiler": False, - "locked": False, - "author_flair_text": None, - "treatment_tags": [], - "visited": False, - "removed_by": None, - "num_reports": None, - "distinguished": None, - "subreddit_id": "t5_2qh1a", - "mod_reason_by": None, - "removal_reason": None, - "link_flair_background_color": "", - "id": "hmgujt", - "is_robot_indexable": True, - "report_reasons": None, - "author": "ForShotgun", - "discussion_type": None, - "num_comments": 213, - "send_replies": True, - "whitelist_status": "all_ads", - "contest_mode": False, - "mod_reports": [], - "author_patreon_flair": False, - "author_flair_text_color": None, - "permalink": "/r/linux/comments/hmgujt/switched_from_windows_10_to_manjaro_never_been/", - "parent_whitelist_status": "all_ads", - "stickied": False, - "url": "https://www.reddit.com/r/linux/comments/hmgujt/switched_from_windows_10_to_manjaro_never_been/", - "subreddit_subscribers": 543995, - "created_utc": 1594070645.0, - "num_crossposts": 0, - "media": None, - "is_video": False, - }, - }, - ], - "after": "t3_hmgujt", - "before": None, - }, -} diff --git a/src/newsreader/news/collection/tests/reddit/stream/tests.py b/src/newsreader/news/collection/tests/reddit/stream/tests.py deleted file mode 100644 index 19aff61..0000000 --- a/src/newsreader/news/collection/tests/reddit/stream/tests.py +++ /dev/null @@ -1,144 +0,0 @@ -from json.decoder import JSONDecodeError -from unittest.mock import patch -from uuid import uuid4 - -from django.test import TestCase - -from newsreader.accounts.tests.factories import UserFactory -from newsreader.news.collection.exceptions import ( - StreamDeniedException, - StreamException, - StreamForbiddenException, - StreamNotFoundException, - StreamParseException, - StreamTimeOutException, -) -from newsreader.news.collection.reddit import RedditStream -from newsreader.news.collection.tests.factories import SubredditFactory -from newsreader.news.collection.tests.reddit.stream.mocks import simple_mock - - -class RedditStreamTestCase(TestCase): - def setUp(self): - self.maxDiff = None - - self.patched_fetch = patch("newsreader.news.collection.reddit.fetch") - self.mocked_fetch = self.patched_fetch.start() - - def tearDown(self): - patch.stopall() - - def test_simple_stream(self): - self.mocked_fetch.return_value.json.return_value = simple_mock - - access_token = str(uuid4()) - user = UserFactory(reddit_access_token=access_token) - - subreddit = SubredditFactory(user=user) - stream = RedditStream(subreddit) - - data, stream = stream.read() - - self.assertEquals(data, simple_mock) - self.assertEquals(stream, stream) - self.mocked_fetch.assert_called_once_with( - subreddit.url, headers={"Authorization": f"bearer {access_token}"} - ) - - def test_stream_raises_exception(self): - self.mocked_fetch.side_effect = StreamException - - access_token = str(uuid4()) - user = UserFactory(reddit_access_token=access_token) - - subreddit = SubredditFactory(user=user) - stream = RedditStream(subreddit) - - with self.assertRaises(StreamException): - stream.read() - - self.mocked_fetch.assert_called_once_with( - subreddit.url, headers={"Authorization": f"bearer {access_token}"} - ) - - def test_stream_raises_denied_exception(self): - self.mocked_fetch.side_effect = StreamDeniedException - - access_token = str(uuid4()) - user = UserFactory(reddit_access_token=access_token) - - subreddit = SubredditFactory(user=user) - stream = RedditStream(subreddit) - - with self.assertRaises(StreamDeniedException): - stream.read() - - self.mocked_fetch.assert_called_once_with( - subreddit.url, headers={"Authorization": f"bearer {access_token}"} - ) - - def test_stream_raises_not_found_exception(self): - self.mocked_fetch.side_effect = StreamNotFoundException - - access_token = str(uuid4()) - user = UserFactory(reddit_access_token=access_token) - - subreddit = SubredditFactory(user=user) - stream = RedditStream(subreddit) - - with self.assertRaises(StreamNotFoundException): - stream.read() - - self.mocked_fetch.assert_called_once_with( - subreddit.url, headers={"Authorization": f"bearer {access_token}"} - ) - - def test_stream_raises_time_out_exception(self): - self.mocked_fetch.side_effect = StreamTimeOutException - - access_token = str(uuid4()) - user = UserFactory(reddit_access_token=access_token) - - subreddit = SubredditFactory(user=user) - stream = RedditStream(subreddit) - - with self.assertRaises(StreamTimeOutException): - stream.read() - - self.mocked_fetch.assert_called_once_with( - subreddit.url, headers={"Authorization": f"bearer {access_token}"} - ) - - def test_stream_raises_forbidden_exception(self): - self.mocked_fetch.side_effect = StreamForbiddenException - - access_token = str(uuid4()) - user = UserFactory(reddit_access_token=access_token) - - subreddit = SubredditFactory(user=user) - stream = RedditStream(subreddit) - - with self.assertRaises(StreamForbiddenException): - stream.read() - - self.mocked_fetch.assert_called_once_with( - subreddit.url, headers={"Authorization": f"bearer {access_token}"} - ) - - def test_stream_raises_parse_exception(self): - self.mocked_fetch.return_value.json.side_effect = JSONDecodeError( - "No json found", "{}", 5 - ) - - access_token = str(uuid4()) - user = UserFactory(reddit_access_token=access_token) - - subreddit = SubredditFactory(user=user) - stream = RedditStream(subreddit) - - with self.assertRaises(StreamParseException): - stream.read() - - self.mocked_fetch.assert_called_once_with( - subreddit.url, headers={"Authorization": f"bearer {access_token}"} - ) diff --git a/src/newsreader/news/collection/tests/reddit/test_scheduler.py b/src/newsreader/news/collection/tests/reddit/test_scheduler.py deleted file mode 100644 index 0f04d53..0000000 --- a/src/newsreader/news/collection/tests/reddit/test_scheduler.py +++ /dev/null @@ -1,142 +0,0 @@ -from datetime import timedelta - -from django.test import TestCase -from django.utils import timezone - -from freezegun import freeze_time - -from newsreader.accounts.tests.factories import UserFactory -from newsreader.news.collection.choices import RuleTypeChoices -from newsreader.news.collection.reddit import RedditScheduler -from newsreader.news.collection.tests.factories import CollectionRuleFactory - - -@freeze_time("2019-10-30 12:30:00") -class RedditSchedulerTestCase(TestCase): - def test_simple(self): - user_1 = UserFactory( - reddit_access_token="1231414", reddit_refresh_token="5235262" - ) - user_2 = UserFactory( - reddit_access_token="3414777", reddit_refresh_token="3423425" - ) - - user_1_rules = [ - CollectionRuleFactory( - user=user_1, - type=RuleTypeChoices.subreddit, - last_run=timezone.now() - timedelta(days=4), - enabled=True, - ), - CollectionRuleFactory( - user=user_1, - type=RuleTypeChoices.subreddit, - last_run=timezone.now() - timedelta(days=3), - enabled=True, - ), - CollectionRuleFactory( - user=user_1, - type=RuleTypeChoices.subreddit, - last_run=timezone.now() - timedelta(days=2), - enabled=True, - ), - ] - - user_2_rules = [ - CollectionRuleFactory( - user=user_2, - type=RuleTypeChoices.subreddit, - last_run=timezone.now() - timedelta(days=4), - enabled=True, - ), - CollectionRuleFactory( - user=user_2, - type=RuleTypeChoices.subreddit, - last_run=timezone.now() - timedelta(days=3), - enabled=True, - ), - CollectionRuleFactory( - user=user_2, - type=RuleTypeChoices.subreddit, - last_run=timezone.now() - timedelta(days=2), - enabled=True, - ), - ] - - scheduler = RedditScheduler() - scheduled_subreddits = scheduler.get_scheduled_rules() - - user_1_batch = [subreddit.pk for subreddit in scheduled_subreddits[0]] - - self.assertIn(user_1_rules[0].pk, user_1_batch) - self.assertIn(user_1_rules[1].pk, user_1_batch) - self.assertIn(user_1_rules[2].pk, user_1_batch) - - user_2_batch = [subreddit.pk for subreddit in scheduled_subreddits[1]] - - self.assertIn(user_2_rules[0].pk, user_2_batch) - self.assertIn(user_2_rules[1].pk, user_2_batch) - self.assertIn(user_2_rules[2].pk, user_2_batch) - - def test_max_amount(self): - users = UserFactory.create_batch( - reddit_access_token="1231414", reddit_refresh_token="5235262", size=5 - ) - - nested_rules = [ - CollectionRuleFactory.create_batch( - name=f"rule-{index}", - type=RuleTypeChoices.subreddit, - last_run=timezone.now() - timedelta(seconds=index), - enabled=True, - user=user, - size=15, - ) - for index, user in enumerate(users) - ] - - rules = [rule for rule_list in nested_rules for rule in rule_list] - - scheduler = RedditScheduler() - scheduled_subreddits = [ - subreddit.pk - for batch in scheduler.get_scheduled_rules() - for subreddit in batch - ] - - for rule in rules[16:76]: - with self.subTest(rule=rule): - self.assertIn(rule.pk, scheduled_subreddits) - - for rule in rules[0:15]: - with self.subTest(rule=rule): - self.assertNotIn(rule.pk, scheduled_subreddits) - - def test_max_user_amount(self): - user = UserFactory( - reddit_access_token="1231414", reddit_refresh_token="5235262" - ) - - rules = [ - CollectionRuleFactory( - name=f"rule-{index}", - type=RuleTypeChoices.subreddit, - last_run=timezone.now() - timedelta(seconds=index), - enabled=True, - user=user, - ) - for index in range(1, 17) - ] - - scheduler = RedditScheduler() - scheduled_subreddits = [ - subreddit.pk - for batch in scheduler.get_scheduled_rules() - for subreddit in batch - ] - - for rule in rules[1:16]: - with self.subTest(rule=rule): - self.assertIn(rule.pk, scheduled_subreddits) - - self.assertNotIn(rules[0].pk, scheduled_subreddits) diff --git a/src/newsreader/news/collection/tests/views/test_crud.py b/src/newsreader/news/collection/tests/views/test_crud.py index ceeb40b..d4bd731 100644 --- a/src/newsreader/news/collection/tests/views/test_crud.py +++ b/src/newsreader/news/collection/tests/views/test_crud.py @@ -88,17 +88,3 @@ class FeedUpdateViewTestCase(CollectionRuleViewTestCase, TestCase): self.rule.refresh_from_db() self.assertEqual(self.rule.category, None) - - def test_rules_only(self): - rule = FeedFactory( - name="Python", - url="https://reddit.com/r/python", - user=self.user, - category=self.category, - type=RuleTypeChoices.subreddit, - ) - url = reverse("news:collection:feed-update", kwargs={"pk": rule.pk}) - - response = self.client.get(url) - - self.assertEqual(response.status_code, 404) diff --git a/src/newsreader/news/collection/tests/views/test_subreddit_views.py b/src/newsreader/news/collection/tests/views/test_subreddit_views.py deleted file mode 100644 index 4eac3b4..0000000 --- a/src/newsreader/news/collection/tests/views/test_subreddit_views.py +++ /dev/null @@ -1,133 +0,0 @@ -from django.test import TestCase -from django.urls import reverse -from django.utils.translation import gettext as _ - -from newsreader.news.collection.choices import RuleTypeChoices -from newsreader.news.collection.models import CollectionRule -from newsreader.news.collection.reddit import REDDIT_API_URL, REDDIT_URL -from newsreader.news.collection.tests.factories import SubredditFactory -from newsreader.news.collection.tests.views.base import CollectionRuleViewTestCase -from newsreader.news.core.tests.factories import CategoryFactory - - -class SubRedditCreateViewTestCase(CollectionRuleViewTestCase, TestCase): - def setUp(self): - super().setUp() - - self.form_data = { - "name": "new rule", - "url": f"{REDDIT_API_URL}/r/aww", - "category": str(self.category.pk), - "reddit_allow_nfsw": False, - "reddit_allow_spoiler": False, - "reddit_allow_viewed": True, - "reddit_upvotes_min": 0, - "reddit_comments_min": 0, - } - - self.url = reverse("news:collection:subreddit-create") - - def test_creation(self): - response = self.client.post(self.url, self.form_data) - - self.assertEqual(response.status_code, 302) - - rule = CollectionRule.objects.get(name="new rule") - - self.assertEqual(rule.type, RuleTypeChoices.subreddit) - self.assertEqual(rule.url, f"{REDDIT_API_URL}/r/aww") - self.assertEqual(rule.favicon, None) - self.assertEqual(rule.category.pk, self.category.pk) - self.assertEqual(rule.user.pk, self.user.pk) - - def test_regular_reddit_url(self): - self.form_data.update(url=f"{REDDIT_URL}/r/aww") - - response = self.client.post(self.url, self.form_data) - - self.assertContains(response, _("This does not look like an Reddit API URL")) - - -class SubRedditUpdateViewTestCase(CollectionRuleViewTestCase, TestCase): - def setUp(self): - super().setUp() - - self.rule = SubredditFactory( - name="Python", - url=f"{REDDIT_API_URL}/r/python.json", - user=self.user, - category=self.category, - type=RuleTypeChoices.subreddit, - ) - self.url = reverse( - "news:collection:subreddit-update", kwargs={"pk": self.rule.pk} - ) - - self.form_data = { - "name": self.rule.name, - "url": self.rule.url, - "category": str(self.category.pk), - "reddit_allow_nfsw": False, - "reddit_allow_spoiler": False, - "reddit_allow_viewed": True, - "reddit_upvotes_min": 0, - "reddit_comments_min": 0, - } - - def test_name_change(self): - self.form_data.update(name="Python 2") - - response = self.client.post(self.url, self.form_data) - self.assertEqual(response.status_code, 302) - - self.rule.refresh_from_db() - - self.assertEqual(self.rule.name, "Python 2") - - def test_category_change(self): - new_category = CategoryFactory(user=self.user) - - self.form_data.update(category=new_category.pk) - - response = self.client.post(self.url, self.form_data) - self.assertEqual(response.status_code, 302) - - self.rule.refresh_from_db() - - self.assertEqual(self.rule.category.pk, new_category.pk) - - def test_subreddit_rules_only(self): - rule = SubredditFactory( - name="Fake subreddit", - url="https://leddit.com/r/python", - user=self.user, - category=self.category, - type=RuleTypeChoices.feed, - ) - url = reverse("news:collection:subreddit-update", kwargs={"pk": rule.pk}) - - response = self.client.get(url) - - self.assertEqual(response.status_code, 404) - - def test_url_change(self): - self.form_data.update(name="aww", url=f"{REDDIT_API_URL}/r/aww") - - response = self.client.post(self.url, self.form_data) - - self.assertEqual(response.status_code, 302) - - rule = CollectionRule.objects.get(name="aww") - - self.assertEqual(rule.type, RuleTypeChoices.subreddit) - self.assertEqual(rule.url, f"{REDDIT_API_URL}/r/aww") - self.assertEqual(rule.favicon, None) - self.assertEqual(rule.category.pk, self.category.pk) - self.assertEqual(rule.user.pk, self.user.pk) - - def test_regular_reddit_url(self): - self.form_data.update(url=f"{REDDIT_URL}/r/aww") - - response = self.client.post(self.url, self.form_data) - - self.assertContains(response, _("This does not look like an Reddit API URL")) diff --git a/src/newsreader/news/collection/urls.py b/src/newsreader/news/collection/urls.py index e482002..a57a00e 100644 --- a/src/newsreader/news/collection/urls.py +++ b/src/newsreader/news/collection/urls.py @@ -14,8 +14,6 @@ from newsreader.news.collection.views import ( FeedCreateView, FeedUpdateView, OPMLImportView, - SubRedditCreateView, - SubRedditUpdateView, ) @@ -49,15 +47,4 @@ urlpatterns = [ name="rules-disable", ), path("rules/import/", login_required(OPMLImportView.as_view()), name="import"), - # Reddit - path( - "subreddits/create/", - login_required(SubRedditCreateView.as_view()), - name="subreddit-create", - ), - path( - "subreddits//", - login_required(SubRedditUpdateView.as_view()), - name="subreddit-update", - ), ] diff --git a/src/newsreader/news/collection/views/__init__.py b/src/newsreader/news/collection/views/__init__.py index 95d7b32..f4009db 100644 --- a/src/newsreader/news/collection/views/__init__.py +++ b/src/newsreader/news/collection/views/__init__.py @@ -3,10 +3,7 @@ from newsreader.news.collection.views.feed import ( FeedUpdateView, OPMLImportView, ) -from newsreader.news.collection.views.reddit import ( - SubRedditCreateView, - SubRedditUpdateView, -) + from newsreader.news.collection.views.rules import ( CollectionRuleBulkDeleteView, CollectionRuleBulkDisableView, @@ -19,8 +16,6 @@ __all__ = [ "FeedCreateView", "FeedUpdateView", "OPMLImportView", - "SubRedditCreateView", - "SubRedditUpdateView", "CollectionRuleBulkDeleteView", "CollectionRuleBulkDisableView", "CollectionRuleBulkEnableView", diff --git a/src/newsreader/news/collection/views/reddit.py b/src/newsreader/news/collection/views/reddit.py deleted file mode 100644 index 4e44e3f..0000000 --- a/src/newsreader/news/collection/views/reddit.py +++ /dev/null @@ -1,27 +0,0 @@ -from django.views.generic.edit import CreateView, UpdateView - -from newsreader.news.collection.choices import RuleTypeChoices -from newsreader.news.collection.forms import SubRedditForm -from newsreader.news.collection.views.base import ( - CollectionRuleDetailMixin, - CollectionRuleViewMixin, -) - - -class SubRedditCreateView( - CollectionRuleViewMixin, CollectionRuleDetailMixin, CreateView -): - form_class = SubRedditForm - template_name = "news/collection/views/subreddit-create.html" - - -class SubRedditUpdateView( - CollectionRuleViewMixin, CollectionRuleDetailMixin, UpdateView -): - form_class = SubRedditForm - template_name = "news/collection/views/subreddit-update.html" - context_object_name = "subreddit" - - def get_queryset(self): - queryset = super().get_queryset() - return queryset.filter(type=RuleTypeChoices.subreddit) diff --git a/src/newsreader/news/core/tests/factories.py b/src/newsreader/news/core/tests/factories.py index d3b62f0..88ce45e 100644 --- a/src/newsreader/news/core/tests/factories.py +++ b/src/newsreader/news/core/tests/factories.py @@ -4,7 +4,6 @@ import factory import factory.fuzzy from newsreader.accounts.tests.factories import UserFactory -from newsreader.news.collection.reddit import REDDIT_API_URL from newsreader.news.core.models import Category, Post @@ -36,10 +35,3 @@ class PostFactory(factory.django.DjangoModelFactory): class FeedPostFactory(PostFactory): rule = factory.SubFactory("newsreader.news.collection.tests.factories.FeedFactory") - - -class RedditPostFactory(PostFactory): - url = factory.fuzzy.FuzzyText(length=10, prefix=f"{REDDIT_API_URL}/") - rule = factory.SubFactory( - "newsreader.news.collection.tests.factories.SubredditFactory" - ) diff --git a/src/newsreader/news/core/views.py b/src/newsreader/news/core/views.py index d05603a..e7fc237 100644 --- a/src/newsreader/news/core/views.py +++ b/src/newsreader/news/core/views.py @@ -20,9 +20,6 @@ class NewsView(NavListMixin, TemplateView): **context, "homepageSettings": { "feedUrl": reverse_lazy("news:collection:feed-update", args=(0,)), - "subredditUrl": reverse_lazy( - "news:collection:subreddit-update", args=(0,) - ), "categoriesUrl": reverse_lazy("news:core:category-update", args=(0,)), "timezone": settings.TIME_ZONE, "autoMarking": self.request.user.auto_mark_read, diff --git a/src/newsreader/scss/elements/button/_button.scss b/src/newsreader/scss/elements/button/_button.scss index 96ee2c8..237e37d 100644 --- a/src/newsreader/scss/elements/button/_button.scss +++ b/src/newsreader/scss/elements/button/_button.scss @@ -13,12 +13,14 @@ cursor: pointer; } - &--success, &--confirm { + &--success, + &--confirm { background-color: var(--confirm-color); color: $white !important; } - &--error, &--cancel { + &--error, + &--cancel { color: $white !important; background-color: var(--danger-color); } @@ -28,15 +30,6 @@ background-color: var(--info-color); } - &--reddit { - color: $white !important; - background-color: $reddit-orange; - - &:hover { - background-color: lighten($reddit-orange, 5%); - } - } - &--disabled { color: var(--font-color) !important; background-color: var(--background-color-secondary) !important; diff --git a/src/newsreader/scss/partials/_colors.scss b/src/newsreader/scss/partials/_colors.scss index 1807a85..d2433f6 100644 --- a/src/newsreader/scss/partials/_colors.scss +++ b/src/newsreader/scss/partials/_colors.scss @@ -59,6 +59,3 @@ $dark-info-color: $blue; $dark-info-font-color: $white; $dark-sidebar-background-color: $dark-background-color-secondary; - -// Third party -$reddit-orange: rgba(255, 69, 0, 1); From 39ede59a5612bf5629f7c1d127c32d806bd3c5ae Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 26 Mar 2025 09:47:52 +0100 Subject: [PATCH 4/7] Add missing migrations --- ...emove_user_reddit_access_token_and_more.py | 21 +++++++++ ...llectionrule_reddit_allow_nfsw_and_more.py | 46 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 src/newsreader/accounts/migrations/0018_remove_user_reddit_access_token_and_more.py create mode 100644 src/newsreader/news/collection/migrations/0018_remove_collectionrule_reddit_allow_nfsw_and_more.py diff --git a/src/newsreader/accounts/migrations/0018_remove_user_reddit_access_token_and_more.py b/src/newsreader/accounts/migrations/0018_remove_user_reddit_access_token_and_more.py new file mode 100644 index 0000000..19bda0c --- /dev/null +++ b/src/newsreader/accounts/migrations/0018_remove_user_reddit_access_token_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.16 on 2025-03-26 08:46 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0017_auto_20240906_0914'), + ] + + operations = [ + migrations.RemoveField( + model_name='user', + name='reddit_access_token', + ), + migrations.RemoveField( + model_name='user', + name='reddit_refresh_token', + ), + ] diff --git a/src/newsreader/news/collection/migrations/0018_remove_collectionrule_reddit_allow_nfsw_and_more.py b/src/newsreader/news/collection/migrations/0018_remove_collectionrule_reddit_allow_nfsw_and_more.py new file mode 100644 index 0000000..39bdb8b --- /dev/null +++ b/src/newsreader/news/collection/migrations/0018_remove_collectionrule_reddit_allow_nfsw_and_more.py @@ -0,0 +1,46 @@ +# Generated by Django 4.2.16 on 2025-03-26 08:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('collection', '0017_remove_collectionrule_timezone'), + ] + + operations = [ + migrations.RemoveField( + model_name='collectionrule', + name='reddit_allow_nfsw', + ), + migrations.RemoveField( + model_name='collectionrule', + name='reddit_allow_spoiler', + ), + migrations.RemoveField( + model_name='collectionrule', + name='reddit_allow_viewed', + ), + migrations.RemoveField( + model_name='collectionrule', + name='reddit_comments_min', + ), + migrations.RemoveField( + model_name='collectionrule', + name='reddit_downvotes_max', + ), + migrations.RemoveField( + model_name='collectionrule', + name='reddit_upvotes_min', + ), + migrations.RemoveField( + model_name='collectionrule', + name='screen_name', + ), + migrations.AlterField( + model_name='collectionrule', + name='type', + field=models.CharField(choices=[('feed', 'Feed')], default='feed', max_length=20), + ), + ] From fb65725e9233f7fba3ba427540adfdcbee685589 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 26 Mar 2025 09:54:16 +0100 Subject: [PATCH 5/7] Fix url usages in templates --- .../templates/news/collection/views/rules.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/newsreader/news/collection/templates/news/collection/views/rules.html b/src/newsreader/news/collection/templates/news/collection/views/rules.html index de8f6c9..e40591c 100644 --- a/src/newsreader/news/collection/templates/news/collection/views/rules.html +++ b/src/newsreader/news/collection/templates/news/collection/views/rules.html @@ -9,20 +9,20 @@
- - -
From 8a6855779918fd955a03671df520b04e22879dfc Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 26 Mar 2025 09:59:11 +0100 Subject: [PATCH 6/7] Remove leftover references --- .../accounts/components/settings-form.html | 38 +++++++++---------- src/newsreader/scss/components/index.scss | 2 - .../integrations/_integrations.scss | 13 ------- .../scss/components/integrations/index.scss | 1 - src/newsreader/scss/pages/index.scss | 1 - .../scss/pages/integrations/index.scss | 5 --- 6 files changed, 17 insertions(+), 43 deletions(-) delete mode 100644 src/newsreader/scss/components/integrations/_integrations.scss delete mode 100644 src/newsreader/scss/components/integrations/index.scss delete mode 100644 src/newsreader/scss/pages/integrations/index.scss diff --git a/src/newsreader/accounts/templates/accounts/components/settings-form.html b/src/newsreader/accounts/templates/accounts/components/settings-form.html index f5e7065..6e81e79 100644 --- a/src/newsreader/accounts/templates/accounts/components/settings-form.html +++ b/src/newsreader/accounts/templates/accounts/components/settings-form.html @@ -2,27 +2,23 @@ {% load i18n %} {% block actions %} -
-
- {% include "components/form/confirm-button.html" %} +
+
+ {% include "components/form/confirm-button.html" %} - - {% trans "Change password" %} - + + {% trans "Change password" %} + - {% if favicon_task_allowed %} - - {% trans "Fetch favicons" %} - - {% else %} - - {% endif %} - - - {% trans "Third party integrations" %} - -
-
+ {% if favicon_task_allowed %} + + {% trans "Fetch favicons" %} + + {% else %} + + {% endif %} +
+
{% endblock actions %} diff --git a/src/newsreader/scss/components/index.scss b/src/newsreader/scss/components/index.scss index dba0131..c8a933a 100644 --- a/src/newsreader/scss/components/index.scss +++ b/src/newsreader/scss/components/index.scss @@ -18,8 +18,6 @@ @import './sidebar/index'; @import './table/index'; -@import './integrations/index'; - @import './rules/index'; @import './post/index'; diff --git a/src/newsreader/scss/components/integrations/_integrations.scss b/src/newsreader/scss/components/integrations/_integrations.scss deleted file mode 100644 index 3fbb593..0000000 --- a/src/newsreader/scss/components/integrations/_integrations.scss +++ /dev/null @@ -1,13 +0,0 @@ -.integrations { - display: flex; - flex-direction: column; - gap: 15px; - - padding: 15px; - - &__controls { - display: flex; - flex-wrap: wrap; - gap: 10px; - } -} diff --git a/src/newsreader/scss/components/integrations/index.scss b/src/newsreader/scss/components/integrations/index.scss deleted file mode 100644 index 7f9e759..0000000 --- a/src/newsreader/scss/components/integrations/index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './integrations'; diff --git a/src/newsreader/scss/pages/index.scss b/src/newsreader/scss/pages/index.scss index 2ac0bb2..44ca8a7 100644 --- a/src/newsreader/scss/pages/index.scss +++ b/src/newsreader/scss/pages/index.scss @@ -12,4 +12,3 @@ @import './rules/index'; @import './settings/index'; -@import './integrations/index'; diff --git a/src/newsreader/scss/pages/integrations/index.scss b/src/newsreader/scss/pages/integrations/index.scss deleted file mode 100644 index ccf52c3..0000000 --- a/src/newsreader/scss/pages/integrations/index.scss +++ /dev/null @@ -1,5 +0,0 @@ -#integrations--page { - .section { - width: 70%; - } -} From c288cfef941606529b5b2504f16090d047fdcc9d Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Thu, 27 Mar 2025 21:54:48 +0100 Subject: [PATCH 7/7] Fix rebase changes --- src/newsreader/js/pages/homepage/components/PostModal.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/newsreader/js/pages/homepage/components/PostModal.js b/src/newsreader/js/pages/homepage/components/PostModal.js index 14551b4..5dacdf8 100644 --- a/src/newsreader/js/pages/homepage/components/PostModal.js +++ b/src/newsreader/js/pages/homepage/components/PostModal.js @@ -25,16 +25,13 @@ class PostModal extends React.Component { if (this.readTimer) { clearTimeout(this.readTimer); } - } - modalListener = (e) => { - const targetClassName = e.target.className; this.readTimer = null; window.removeEventListener('click', this.modalListener); } - modalListener(e) { + modalListener = (e) => { const targetClassName = e.target.className; if (this.props.post && targetClassName == 'modal post-modal') {