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

Add support for searching by usage rights #19

Merged
merged 1 commit into from Oct 11, 2018

Conversation

@stevemar
Copy link
Contributor

stevemar commented Oct 11, 2018

A common search option, conveniently exposed by the google image search API, is to filter by copyright usage.

As part of the advanced options, which is where the aspect ratio and image type are bundled is the usage rights option, below are the values for each option:

  sur:fmc (labeled for reuse with modification)
  sur:fc (labeled for reuse)
  sur:fm (labeled for noncommercial reuse with modification)
  sur:f (labeled for noncommercial reuse)

This PR adds a new option, --usage-rights , to the CLI with a few preset values for users to choose based on the options mentioned above.


Here are a few URLs you can test with:


Thanks for making this great tool!

A common search option, conveniently exposed by the google image
search image, is to filter by copyright usage.

As part of the advanced options, which is where the aspect ratio
and image type are bundled is the usage rights option, below are
the values for each option:

  sur:fmc (labeled for reuse with modification)
  sur:fc (labeled for reuse)
  sur:fm (labeled for noncommercial reuse with modification)
  sur:f (labeled for noncommercial reuse)

This PR adds a new option, --usage-rights <usage-rights> to the
CLI, with a few preset values for users to choose based on the
options mentioned above.
@stevemar

This comment has been minimized.

Copy link
Contributor Author

stevemar commented Oct 11, 2018

To support the PR, I tested this manually on my laptop, here are my results.

reuse

Steves-MacBook-Pro:googliser stevemar$ ./googliser.sh --debug --usage-rights reuse -p cows
 googliser.sh - 2018-07-26 PID:[24402]

 -> processing query: "cows"
 -> searching Google:        1/10 result groups downloaded. 65 results!
 -> acquiring images:       25/25 downloaded and        3/40 failed. (11%)                        
 -> building gallery: done!                               

 -> All done!
Steves-MacBook-Pro:googliser stevemar$ open cows/googliser-gallery-\(cows\).png 
Steves-MacBook-Pro:googliser stevemar$ rm -rf cows

reuse with modification

Steves-MacBook-Pro:googliser stevemar$ ./googliser.sh --debug --usage-rights reuse-with-mod -p cows
 googliser.sh - 2018-07-26 PID:[29047]

 -> processing query: "cows"
 -> searching Google:        1/10 result groups downloaded. 65 results!
 -> acquiring images:       25/25 downloaded and        3/40 failed. (11%)                        
 -> building gallery: done!                               

 -> All done!
Steves-MacBook-Pro:googliser stevemar$ open cows/googliser-gallery-\(cows\).png 
Steves-MacBook-Pro:googliser stevemar$ rm -rf cows 

non-commercial reuse

Steves-MacBook-Pro:googliser stevemar$ ./googliser.sh --debug --usage-rights noncomm-reuse -p cows
 googliser.sh - 2018-07-26 PID:[32119]

 -> processing query: "cows"
 -> searching Google:        1/10 result groups downloaded. 65 results!
 -> acquiring images:       25/25 downloaded and        3/40 failed. (11%)                        
 -> building gallery: done!                               

 -> All done!
Steves-MacBook-Pro:googliser stevemar$ open cows/googliser-gallery-\(cows\).png 
Steves-MacBook-Pro:googliser stevemar$ rm -rf cows 

non-commercial reuse with modification

Steves-MacBook-Pro:googliser stevemar$ ./googliser.sh --debug --usage-rights noncomm-reuse-with-mod -p cows
 googliser.sh - 2018-07-26 PID:[34600]

 -> processing query: "cows"
 -> searching Google:        1/10 result groups downloaded. 65 results!
 -> acquiring images:       25/25 downloaded and        3/40 failed. (11%)                        
 -> building gallery: done!                               

 -> All done!
Steves-MacBook-Pro:googliser stevemar$ open cows/googliser-gallery-\(cows\).png 
Steves-MacBook-Pro:googliser stevemar$ rm -rf cows 

bad input

Steves-MacBook-Pro:googliser stevemar$ ./googliser.sh --debug --usage-rights noncomm-reuse-witassh-mod -p cows
^[OR googliser.sh - 2018-07-26 PID:[37569]

 !! (--usage-rights) preset invalid

 use '-h' or '--help' to display parameter list.
@stevemar

This comment has been minimized.

Copy link
Contributor Author

stevemar commented Oct 11, 2018

I also searched for cows without specifying --usage-rights and then specifying it with usage-rights=reuse and compared the two. They are indeed different and similar to what I was seeing when using google image search with the reuse option.

Gallery with no usage-rights specified

screen shot 2018-10-10 at 10 15 45 pm

Gallery with usage-rights = reuse specified

screen shot 2018-10-10 at 10 15 53 pm

Google image search with usage-rights set to reuse

screen shot 2018-10-10 at 10 16 31 pm

Copy link

OneCDOnly left a comment

Great work Steve! Happy to add this feature. 👍

@teracow teracow merged commit a0e7dbc into teracow:master Oct 11, 2018
@teracow

This comment has been minimized.

Copy link
Owner

teracow commented Oct 11, 2018

Agree, nicely done. Thank you Steve, it's something I should have added long ago. :)

@stevemar

This comment has been minimized.

Copy link
Contributor Author

stevemar commented Oct 11, 2018

@teracow thanks! happy to contribute to this project :)

@stevemar stevemar deleted the stevemar:reuse branch Oct 11, 2018
@stevemar stevemar referenced this pull request Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.