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

Added only_links_like Feature #50

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

Conversation

hartator
Copy link

Hi!

Thanks a lot for anemone guys!

I missed a feature that I have implemented, basically the reverse of skip_links_like, which I have called only_links_like to help the crawler to follow only links which matches specified patterns.

Anyway, I wish you great succes with your project!

Best,
Julian

@rcarvalho
Copy link

I second this feature! I basically implemented the same thing locally on my machine so I could get it to work. I guess I should've checked here first. Anemone is awesome, btw!

@@ -292,10 +302,18 @@ def skip_query_string?(link)

#
# Returns +true+ if *link* should not be visited because
# its URL matches a skip_link pattern.
# its URL matches a skip_link pattern or not matches a only_link pattern.
#
def skip_link?(link)
Copy link
Contributor

Choose a reason for hiding this comment

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

@only_link_patterns.empty? 
 ? @skip_link_patterns.any? { |pattern| link.path =~ pattern }
 : !@only_link_patterns.any? { |pattern| link.path =~ pattern }

@hartator would u care to re-submit in the Medusa fork?

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