Playnite Forums
Return number of online search results? (PowerShell) - Printable Version

+- Playnite Forums (https://playnite.link/forum)
+-- Forum: Development (https://playnite.link/forum/forum-10.html)
+--- Forum: Extensions (https://playnite.link/forum/forum-5.html)
+--- Thread: Return number of online search results? (PowerShell) (/thread-920.html)



Return number of online search results? (PowerShell) - OneAngryGamer - 11-01-2021

I have some ideas for creating two new extensions that will be unlike any other Playnite extension.

To make this work, one of the things I need is code to return the number of search results for each game name.

e.g. If I run the function using "Tetris", it should return something like 17,000,000

If anybody is able to help me solve this I would appreciate it. (I will also credit your involvement when these extensions are released)


RE: Return number of online search results? [PowerShell] - darklinkpower - 11-01-2021

I think you need to be more specific. Results from where exactly? If it's from google, a simple regex to the page source will do the trick https://regexr.com/68lr8

Then use -match and the value will be in the index one of $matches


RE: Return number of online search results? [PowerShell] - OneAngryGamer - 11-01-2021

(11-01-2021, 11:48 PM)darklinkpower Wrote: I think you need to be more specific. Results from where exactly? If it's from google, a simple regex to the page source will do the trick https://regexr.com/68lr8

Then use -match and the value will be in the index one of $matches

Thanks darklinkpower. I was avoiding being specific because I don't care which online search engine ends up being used.

Hmmm. I suppose I could regex the page source. (I do just that in an unreleased extension for downloading tags from a number of websites)


RE: Return number of online search results? [PowerShell] - darklinkpower - 11-02-2021

I see. The issue is the needed actual implementation will be unique to each page you may want to use, it's not possible to have a global solution.


RE: Return number of online search results? [PowerShell] - OneAngryGamer - 11-16-2021

(11-02-2021, 05:31 AM)darklinkpower Wrote: The issue is the needed actual implementation will be unique to each page you may want to use

The extension would be using the same search engine for every search made. Why would the regex be unique for each search?


RE: Return number of online search results? (PowerShell) - OneAngryGamer - 08-02-2023

I doubt I will ever get around to creating this so I will give away the ideas for anybody to use if they want.



What this would have done is to create a formula for concepts like Cult Classics or Hidden Gems. Games that meet the formula requirements could then be tagged and filtered.



Cult Classic = (Community Rating = High AND Game Sales = Low)



Hidden Gem = (Community Rating = High AND Awareness = Low)




Comments:
  • Community Rating could be obtained from websites such as MetaCritic or MobyGames
  • Awareness would be calculated by Number of Search Engine Results for GameName (+Platform Name?)  / Max Awareness.
  • Max Awareness = Highest awareness number found for any game (I'm guessing Pacman Tetris or Space Invaders?)
  • Games Sales would need a website that tracks games sales. It would need to be divided by the number of consoles sold to keep it relative. Some old games may not appear to be best sellers if compared to modern AAA releases but they are best sellers as a percentage of that console sold.
  • The thresholds for High and Low are arbitrary - these percentages would need to be tweaked by the developer.
  • Not just Cult Classic + Hidden Gem. This could also be used to find & tag games that are Best Sellers - (Total Games Sold / Consoles Sold = HIGH)