Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement Coomer #2214

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

goawaylovestrike
Copy link
Contributor

Added performers from description starting with @ and tags starting with # if no tags are found in the post. Also fixed issue with extracting special characters from my last pull.

@feederbox826
Copy link
Collaborator

The convention is to have username (Network) for FansDB but LGTM

@@ -14,6 +14,12 @@
'Referer': 'https://coomer.su/search_hash'
}

def extract_mentions_and_tags(text):
mentions = re.findall(r'@([\w\-.]+)', text) if text else []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usernames can also have digits and _

@@ -14,6 +14,12 @@
'Referer': 'https://coomer.su/search_hash'
}

def extract_mentions_and_tags(text):
mentions = re.findall(r'@([\w\-.]+)', text) if text else []
hashtags = re.findall(r'#([\w\-.]+)', text) if text else []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar with hashtags, you might want to keep scanning until you hit another # or word boundary


out = {
"Title": post['title'],
"Date": post['published'][:10],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to instead split on T of ISO8601 or a more robust parsing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants