protected override List <RomData> ScraperSpecificSearch(RomData dataToSearchFor) { List <RomData> returnList = new List <RomData>(); string nameTerm = GenerateSearchableName(dataToSearchFor); string searchTerm = String.Format(searchUrl, apiKey, nameTerm, ConvertConsole(dataToSearchFor.Console)); string finalUrl = String.Format("{0}{1}", rootUrl, searchTerm); string results = MakeTextRequest(finalUrl); if (!String.IsNullOrEmpty(results)) { MobyGamesSearchResults searchResults = SerializationUtilities.DeserializeString <MobyGamesSearchResults>(results, DataFormat.JSON); if (searchResults != null) { foreach (var game in searchResults.games) { RomData convertedData = dataToSearchFor.Clone(); convertedData.FriendlyName = game.title; convertedData.ScraperUniqueKey = game.game_id.ToString(); returnList.Add(convertedData); } } } return(returnList); }
protected override List <RomData> ScraperSpecificSearch(RomData dataToSearchFor) { List <RomData> data = new List <RomData>(); String nameTerm = GenerateSearchableName(dataToSearchFor); String platformTerm = ConvertConsole(dataToSearchFor.Console); String searchPage = String.Format(searchPageformat, nameTerm, platformTerm); String finalUrl = String.Format("{0}{1}", rootUrl, searchPage); String results = MakeTextRequest(finalUrl); if (results != String.Empty) { Data resultsData = SerializationUtilities.DeserializeString <Data>(results, DataFormat.XML); foreach (var resultData in resultsData.Game) { RomData convertedResultData = dataToSearchFor.Clone(); convertedResultData.FriendlyName = resultData.GameTitle; convertedResultData.ScraperUniqueKey = resultData.id; convertedResultData.ReleaseDate = String.IsNullOrEmpty(resultData.ReleaseDate) ? DateTime.MaxValue : DateTime.Parse(resultData.ReleaseDate); convertedResultData.Console = ConvertConsole(resultData.Platform); data.Add(convertedResultData); } } return(data); }
protected override List <RomData> ScraperSpecificSearch(RomData dataToSearchFor) { string nameTerm = GenerateSearchableName(dataToSearchFor); string searchTerm = string.Format(searchFormat, nameTerm); string finalUrl = String.Format("{0}{1}", searchRootUrl, searchTerm); List <RomData> returnData = new List <RomData>(); String results = MakeTextRequest(finalUrl, headers); if (results != String.Empty) { List <IgdbData> resultsData = SerializationUtilities.DeserializeString <List <IgdbData> >( results, DataFormat.JSON, platformConverter, dateConverter); foreach (var resultData in resultsData) { RomData convertedData = dataToSearchFor.Clone(); convertedData.FriendlyName = resultData.name; convertedData.ScraperUniqueKey = resultData.id; if (resultData.release_dates != null && resultData.release_dates.Count() > 0) { var releaseData = resultData.release_dates[0]; convertedData.Console = releaseData.platform; convertedData.ReleaseDate = releaseData.date; } returnData.Add(convertedData); } } return(returnData); }
public RomData GetAllData(RomData dataToFillOut) { RomData foundData = dataToFillOut.Clone(); foundData.ScrapedBy = FriendlyName; foundData.IsUpToDate = true; return(ScraperSpecificGetAllData(foundData)); }
protected override List <RomData> ScraperSpecificSearch(RomData dataToSearchFor) { List <RomData> returnList = new List <RomData>(); string nameTerm = GenerateSearchableName(dataToSearchFor); string searchTerm = String.Format(searchUrl, apiKey, nameTerm); string finalUrl = String.Format("{0}{1}", rootUrl, searchTerm); string results = MakeTextRequest(finalUrl, headers); if (results != String.Empty) { GiantBombSearchResults resultData = SerializationUtilities.DeserializeString <GiantBombSearchResults>(results, DataFormat.JSON, consoleConverter, dateConverter); if (resultData.results != null) { foreach (var res in resultData.results) { RomData convertedData = dataToSearchFor.Clone(); convertedData.FriendlyName = res.name; convertedData.ScraperUniqueKey = res.id.ToString(); convertedData.ReleaseDate = res.original_release_date; convertedData.Console = EmulatorConsoles.UNKNOWN; if (res.platforms?.Length > 0) { foreach (var platform in res.platforms) { convertedData.Console = platform.platform; if (!convertedData.Console.Equals(EmulatorConsoles.UNKNOWN)) { break; } } } returnList.Add(convertedData); } } } return(returnList); }