{"action":"created","issue":{"url":"https://api.github.com/repos/RetroPie/RetroPie-Setup/issues/945","labels_url":"https://api.github.com/repos/RetroPie/RetroPie-Setup/issues/945/labels{/name}","comments_url":"https://api.github.com/repos/RetroPie/RetroPie-Setup/issues/945/comments","events_url":"https://api.github.com/repos/RetroPie/RetroPie-Setup/issues/945/events","html_url":"https://github.com/RetroPie/RetroPie-Setup/issues/945","id":100400269,"number":945,"title":"Add Sselph's Scraper as a module","user":{"login":"HerbFargus","id":10035308,"avatar_url":"https://avatars.githubusercontent.com/u/10035308?v=3","gravatar_id":"","url":"https://api.github.com/users/HerbFargus","html_url":"https://github.com/HerbFargus","followers_url":"https://api.github.com/users/HerbFargus/followers","following_url":"https://api.github.com/users/HerbFargus/following{/other_user}","gists_url":"https://api.github.com/users/HerbFargus/gists{/gist_id}","starred_url":"https://api.github.com/users/HerbFargus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HerbFargus/subscriptions","organizations_url":"https://api.github.com/users/HerbFargus/orgs","repos_url":"https://api.github.com/users/HerbFargus/repos","events_url":"https://api.github.com/users/HerbFargus/events{/privacy}","received_events_url":"https://api.github.com/users/HerbFargus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-08-11T20:21:33Z","updated_at":"2015-08-29T00:14:48Z","closed_at":null,"body":"Mostly completed- just needs some work on a checklist to choose scrapers by system (function scraper_system)\r\n\r\n```\r\n#!/usr/bin/env bash\r\n\r\n# This file is part of RetroPie.\r\n# \r\n# (c) Copyright 2012-2015  Florian Müller (contact@petrockblock.com)\r\n# \r\n# See the LICENSE.md file at the top-level directory of this distribution and \r\n# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md\r\n#\r\n\r\nrp_module_id=\"scraper\"\r\nrp_module_desc=\"Steven Selph's Scraper\"\r\nrp_module_menus=\"3+\"\r\n\r\nfunction scraper_install() {\r\necho \"Downloading and Installing Scraper created by SSELPH...\"\r\nscraperVersion=$(wget -qO- https://api.github.com/repos/sselph/scraper/releases/latest | grep tag_name | sed -e 's/.*\"tag_name\": \"\\(.*\\)\".*/\\1/')\r\n    if isPlatform \"rpi2\"; then\r\n        wget https://github.com/sselph/scraper/releases/download/$scraperVersion/scraper_rpi2.zip -q\r\n        unzip scraper_rpi2.zip scraper -d /usr/local/bin/\r\n        rm scraper_rpi2.zip\r\n    else\r\n        wget https://github.com/sselph/scraper/releases/download/$scraperVersion/scraper_rpi.zip -q\r\n        unzip scraper_rpi.zip scraper -d /usr/local/bin/\r\n        rm scraper_rpi.zip\r\n    fi\r\n    printMsgs \"dialog\" \"$scraperVersion Scraper Installed\"\r\n}\r\n\r\nfunction scraper_all() {\r\nsu pi -c \"/usr/local/bin/scraper -scrape_all -thumb_only\"\r\nprintMsgs \"dialog\" \"All games scraped\"\r\n}\r\n\r\nfunction scraper_system() {\r\n#show scraper menu - ask user which console they would like to scrape\t\t\t\t\t\r\nromFolderList=$(grep \"<path>\" /etc/emulationstation/es_systems.cfg | sed \"s/<path>//g\" | sed \"s/<\\/path>//g\" | sed \"s/~/\\/home\\/pi/g\" | awk '{print $0; print NR; print \"OFF\";}')\r\nesSystemsList+=$romFolderList\r\n    romFolders=$(whiptail --backtitle \"PiAssist\" --checklist \"Select ROM Folders\" 0 0 0 $romFolderList 3>&1 1>&2 2>&3)\r\n    exit_status=$?\r\n\tromFolderAcutallySelected=true\r\n\tcase $exit_status in\r\n\t$DIALOG_CANCEL)\r\n\tromFolderAcutallySelected=false\r\n\t;;\r\n\t$DIALOG_ESC)\r\n\tromFolderAcutallySelected=false\r\n\t;;\r\n\tesac\r\n\t\t\tif [ $romFolderAcutallySelected == true ] ; then\r\n\t\t\tromFolders=$(echo \"$romFolders\" | sed \"s/\\\" \\\"/\\\\n/g\" | sed \"s/\\\"//g\")\r\n\t\t\techo \"Scraping...\"\r\n\t\t\twhile read -r romFolder; do\r\n\t\t\tgameListXMLLocation=\"/home/pi/.emulationstation/gamelists/$(basename $romFolder)/gamelist.xml\"\r\n\t\t\t\t\t#if mame, then we need to use the mame \r\n\t\t\t\t\tif [[ $romFolder == *\"mame\"* ]]; then\r\n\t\t\t\t\tscraper -mame -mame_img \"t,m,s\" -image_dir=\"/home/pi/.emulationstation/downloaded_images/$(basename $romFolder)\" -image_path=\"~/.emulationstation/downloaded_images/$(basename $romFolder)\" -output_file=\"$gameListXMLLocation\" -rom_dir=\"$romFolder\"\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\tscraper -image_dir=\"/home/pi/.emulationstation/downloaded_images/$(basename $romFolder)\" -image_path=\"/home/pi/.emulationstation/downloaded_images/$(basename $romFolder)\" -output_file=\"$gameListXMLLocation\" -rom_dir=\"$romFolder\"\r\n\t\t\t\t\t\t\tfi\r\n\t\t\t\t\t\t\t\tchown pi:pi \"/home/pi/.emulationstation/downloaded_images/$(basename $romFolder)\"\r\n\t\t\t\t\t\t\t\t#the scraper doesn't include the opening XML tag that is required\r\n\t\t\t\t\t\t\t\tif grep -q \"<?xml\" \"$gameListXMLLocation\" ; then\r\n\t\t\t\t\t\t\t\t#no action needs to occur\r\n\t\t\t\t\t\t\t\techo \"\" > /dev/null\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\techo '<?xml version=\"1.0\"?>' | cat - \"$gameListXMLLocation\" > temp && mv temp \"$gameListXMLLocation\"\r\n\t\t\t\t\t\t\t\tfi\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tchown pi:pi \"$gameListXMLLocation\"\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tfind \"/home/pi/.emulationstation/downloaded_images/$(basename $romFolder)\" -exec chown pi:pi {} +\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tif [[ -e temp ]]; then\r\n\t\t\t\t\trm temp\r\n\t\t\t\t\tfi\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tdone <<< \"$romFolders\"\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tprintMsgs \"dialog\" \"ROMs have been scraped.\"\r\n\t\t\t\t\t\t\tfi\r\n\t\t\t\t\t\tfi\r\n\t\t\t\t\tfi\r\n}\r\n\r\nfunction configure_scraper() {\r\n    scraperVersion=$(wget -qO- https://api.github.com/repos/sselph/scraper/releases/latest | grep tag_name | sed -e 's/.*\"tag_name\": \"\\(.*\\)\".*/\\1/')\r\n    currentVersion=$(/usr/local/bin/scraper --version)\r\n\r\n    while true; do\r\n        cmd=(dialog --title \"Steven Selph's Scraper.\"  --backtitle \"$__backtitle\" --menu \"Latest Version:    $scraperVersion\\nInstalled Version: $currentVersion\" 22 76 16)\r\n        options=(\r\n            1 \"Install Latest Scraper\"\r\n            2 \"Scrape All Systems\"\r\n            3 \"Scrape System(s) From List\"\r\n        )\r\n        choice=$(\"${cmd[@]}\" \"${options[@]}\" 2>&1 >/dev/tty)\r\n        if [[ -n \"$choice\" ]]; then\r\n            case $choice in\r\n                1)\r\n                    scraper_install\r\n                    ;;\r\n                2)\r\n                    scraper_all\r\n                    ;;\r\n                3)\r\n                    scraper_system\r\n                    ;;\r\n            esac\r\n        else\r\n            break\r\n        fi\r\n    done\r\n}\r\n```\r\nadapted from https://github.com/Death259/PiAssist"},"comment":{"url":"https://api.github.com/repos/RetroPie/RetroPie-Setup/issues/comments/135919911","html_url":"https://github.com/RetroPie/RetroPie-Setup/issues/945#issuecomment-135919911","issue_url":"https://api.github.com/repos/RetroPie/RetroPie-Setup/issues/945","id":135919911,"user":{"login":"joolswills","id":5365574,"avatar_url":"https://avatars.githubusercontent.com/u/5365574?v=3","gravatar_id":"","url":"https://api.github.com/users/joolswills","html_url":"https://github.com/joolswills","followers_url":"https://api.github.com/users/joolswills/followers","following_url":"https://api.github.com/users/joolswills/following{/other_user}","gists_url":"https://api.github.com/users/joolswills/gists{/gist_id}","starred_url":"https://api.github.com/users/joolswills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joolswills/subscriptions","organizations_url":"https://api.github.com/users/joolswills/orgs","repos_url":"https://api.github.com/users/joolswills/repos","events_url":"https://api.github.com/users/joolswills/events{/privacy}","received_events_url":"https://api.github.com/users/joolswills/received_events","type":"User","site_admin":false},"created_at":"2015-08-29T00:14:48Z","updated_at":"2015-08-29T00:14:48Z","body":"Interested in hearing peoples preferred configurations for the scraper, such as if they use thumb-only, or prefer screenshots over marquees etc (please give me your commandline params)"}}