ninja2bceen Posted October 24, 2014 Share Posted October 24, 2014 To whom it concerns, I saw this on ign. Apparently google has gaming info now, maybe we can scrap it somehow? Google Search Provides Info About Video Games http://m.ign.com/articles/2014/10/24/google-search-adds-info-about-video-games Link to comment Share on other sites More sharing options...
derekablackburn Posted November 20, 2014 Share Posted November 20, 2014 I've been scraping info from thegamesdb with a powershell script Link to comment Share on other sites More sharing options...
BiLbOBaggins Posted November 20, 2014 Share Posted November 20, 2014 I've been scraping info from thegamesdb with a powershell script share? Link to comment Share on other sites More sharing options...
derekablackburn Posted November 21, 2014 Share Posted November 21, 2014 Not sure if this requires powershell v4 or 2 but here it is, just point it too a folder of roms that are correctly named (folder must be correctly named too... i.e. Nintendo Game Boy Advance): [void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $form = new-object Windows.Forms.Form $objShell = new-object -com shell.application $objFolder = $objShell.BrowseForFolder(0,"Title",0,"c:\users\$Env:USERNAME"); Set-Location $objFolder.self.path $plat = (Get-Item .\).Name $list = (Get-ChildItem).BaseName $output = @" <?xml version="1.0"?> <menu> <header> <listname>$plat</listname> <lastlistupdate>$(get-date -format "yyyy.MM.dd")</lastlistupdate> <listversion>1.0</listversion> <exporterversion>Powershell thegamesdb.net scraper</exporterversion> </header> "@ $list.ForEach({ $current = $_ | select-string -Pattern "^.*(?=\()" | %{$_.matches} | %{$_.value} $pull = Invoke-RestMethod -Method GET -Uri "http://thegamesdb.net/api/GetGame.php?name=$current&platform=$plat" $info = $pull.Data.Game | select -first 1 $game = @" <game name="$($_)" index="" image=""> <description>($($info.overview))</description> <cloneof></cloneof> <crc></crc> <manufacturer>$($info.Publisher)</manufacturer> <year>$(([datetime]$info.ReleaseDate).Year)</year> <genre>$($info.Genres.genre)</genre> <rating>$($info.ESRB)</rating> <enabled>Yes</enabled> </game> "@ $output += $game }) $output += "</menu>" $output Link to comment Share on other sites More sharing options...
ninja2bceen Posted November 22, 2014 Author Share Posted November 22, 2014 How can we utilize this in hyperspin? Link to comment Share on other sites More sharing options...
derekablackburn Posted November 22, 2014 Share Posted November 22, 2014 As in how do you run it? Or how do you use the information? I'm not sure about what use it would be unless you needed to update your hyperpause info files or you needed to create an a game database xml with just the games you have in folder. To run it you need to put it into a text file and change the extension to .ps1, then open powershell on your computer (windows 7 or up) and run the file, it will ask for the directory your roms are in and then generate the xml output. Link to comment Share on other sites More sharing options...
ninja2bceen Posted November 23, 2014 Author Share Posted November 23, 2014 Im Thinking how to use it. Game menus probably not. Maybe game info in hyperpause? Maybe u can post a sample? Link to comment Share on other sites More sharing options...
derekablackburn Posted November 23, 2014 Share Posted November 23, 2014 If you need need a specific file output I can modify it easily. Link to comment Share on other sites More sharing options...
derekablackburn Posted November 24, 2014 Share Posted November 24, 2014 I've updated the script to generate something more like the hyperlaunch game info files. [void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $form = new-object Windows.Forms.Form $objShell = new-object -com shell.application $objFolder = $objShell.BrowseForFolder(0,"Title",0,"c:\users\$Env:USERNAME"); Set-Location $objFolder.self.path $plat = (Get-Item .\).Name $list = (Get-ChildItem).BaseName $list.ForEach({ $current = $_ | select-string -Pattern "^.*(?=\()" | %{$_.matches} | %{$_.value} $pull = Invoke-RestMethod -Method GET -Uri "http://thegamesdb.net/api/GetGame.php?name=$current&platform=$plat" $info = $pull.Data.Game | select -first 1 $game = @" [$($info.GameTitle)] Publisher=$($info.Publisher) Developer=$($info.Developer) Released=$([datetime]$info.ReleaseDate) Systems=$($info.Platform) Genre=$($info.Genres.genre) Players=$($info.Players) Rating=$($info.ESRB) Description=$($info.Overview) `r`n "@ $output += $game }) $output Link to comment Share on other sites More sharing options...
ninja2bceen Posted December 6, 2014 Author Share Posted December 6, 2014 Boy there are smart people here. Can u provide a tutorial of how to use this and what it does and where to put it? Link to comment Share on other sites More sharing options...
derekablackburn Posted December 6, 2014 Share Posted December 6, 2014 Its just a sample use case. If you need specific information I can write a script pretty easily and explain how to use it. Link to comment Share on other sites More sharing options...
BiLbOBaggins Posted December 13, 2014 Share Posted December 13, 2014 .. WoW, impressive script! Thanks for sharing man. Link to comment Share on other sites More sharing options...
derekablackburn Posted December 13, 2014 Share Posted December 13, 2014 Thanks Link to comment Share on other sites More sharing options...
ninja2bceen Posted December 14, 2014 Author Share Posted December 14, 2014 Can u take a screenshot of what it did? I see the text u are nabbing but trying to figure out what it does, how it displays and where u put the code Link to comment Share on other sites More sharing options...
derekablackburn Posted December 14, 2014 Share Posted December 14, 2014 Can u take a screenshot of what it did? I see the text u are nabbing but trying to figure out what it does, how it displays and where u put the code Ninja put the script in a text file called script.ps1 open powershell go to the directory it is in and then use the command .\script.ps1 it will prompt for a folder location. Link to comment Share on other sites More sharing options...
ninja2bceen Posted December 14, 2014 Author Share Posted December 14, 2014 Sorry man, powershell is a new app for me, ill have to research it a bit. I take it after u get that info u somehow incorporate it in hyperspin Link to comment Share on other sites More sharing options...
derekablackburn Posted December 14, 2014 Share Posted December 14, 2014 What version of windows are you running? Link to comment Share on other sites More sharing options...
ninja2bceen Posted December 14, 2014 Author Share Posted December 14, 2014 Windows 7 64 bit Link to comment Share on other sites More sharing options...
derekablackburn Posted December 14, 2014 Share Posted December 14, 2014 Open the start menu and tyoebin powershell its right there. Link to comment Share on other sites More sharing options...
Iggy Posted December 15, 2014 Share Posted December 15, 2014 Hey Derekablackburn....when I try running your script (both of em that you posted)I receive the following error: Method invocation failed because [system.String] doesn't contain a method named 'ForEach'. + $list.ForEach({ + ~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: ( [], RuntimeException + FullyQualifiedErrorId : MethodNotFound Something I can check on my end? (I have a folder that has a couple of text files with names of the games...to simulate a rom folder). I tried usin ps4 and 3....on win x64 system. Link to comment Share on other sites More sharing options...
SIMPLYAUSTIN Posted December 15, 2014 Share Posted December 15, 2014 Hmmmm that is an interesting thing to have. So in theory you can scrape for every game in real time as long as you have an internet connection? Link to comment Share on other sites More sharing options...
derekablackburn Posted December 15, 2014 Share Posted December 15, 2014 Hey Derekablackburn....when I try running your script (both of em that you posted)I receive the following error:Method invocation failed because [system.String] doesn't contain a method named 'ForEach'. + $list.ForEach({ + ~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: ( [], RuntimeException + FullyQualifiedErrorId : MethodNotFound Something I can check on my end? (I have a folder that has a couple of text files with names of the games...to simulate a rom folder). I tried usin ps4 and 3....on win x64 system. Run $psversiontable in your powershell prompt, more than likely you are running version 2 you need to run version 4 for this script foreach loops are handled differently between the two versions. Link to comment Share on other sites More sharing options...
derekablackburn Posted December 15, 2014 Share Posted December 15, 2014 Hmmmm that is an interesting thing to have. So in theory you can scrape for every game in real time as long as you have an internet connection? Yes you could. Link to comment Share on other sites More sharing options...
Iggy Posted December 15, 2014 Share Posted December 15, 2014 Run $psversiontable in your powershell prompt, more than likely you are running version 2 you need to run version 4 for this script foreach loops are handled differently between the two versions. Yeah I tried with version 4 with no luck....same error. I'll Prolly have a look in more detail tonight. Are you importing any other classes beside the Windows forms? Anyone else having the same issues I'm running into? Link to comment Share on other sites More sharing options...
derekablackburn Posted December 15, 2014 Share Posted December 15, 2014 Yeah I tried with version 4 with no luck....same error. I'll Prolly have a look in more detail tonight. Are you importing any other classes beside the Windows forms?Anyone else having the same issues I'm running into? The only other reason you would get that error is if you tried to run the script against a folder that didn't have any items in it. In that case there would be no foreach method because you have to have multiple items for the method to be available. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.