| 51 | | "the minimum number of days of data that $grabber can reliably fetch,\n" . |
| 52 | | "where today is day 1.\n\n"; |
| 53 | | |
| 54 | | $config->{min_days} = ask("Minimum days supported? [default=7]"); |
| 55 | | $config->{min_days} ||= 7; |
| | 50 | "the minimum number of days of data that $grabber can reliably fetch.\n\n"; |
| | 51 | |
| | 52 | $config->{max_reliable_days} = ask("Days reliably supported? [default=7]"); |
| | 53 | $config->{max_reliable_days} ||= 7; |
| | 54 | |
| | 55 | print "\nCATEGORY: Regions Supported\n\n" . |
| | 56 | "Enter the region IDs supported by $grabber. If $grabber supports\n" . |
| | 57 | "all regions, just hit Enter. If it supports a limited number of regions,\n" . |
| | 58 | "enter these separated by spaces (e.g. \"94 104 118\"). If it supports\n" . |
| | 59 | "most but not all regions, enter a minus sign followed by a list of the\n" . |
| | 60 | "unsupported regions (e.g. \"-112 114 128\").\n\n"; |
| | 61 | |
| | 62 | $config->{regions} = ask("Regions supported?"); |
| 80 | | $config->{option_read} ||= '--version'; |
| 81 | | } |
| 82 | | |
| 83 | | print "\nCATEGORY: Niceness\n\n" . |
| 84 | | "NOTE: This metric will probably change, so don't sweat it for now.\n". |
| 85 | | "Rate the niceness of $grabber. Niceness is a general score out\n" . |
| 86 | | "of 10 for how quickly, efficiently, and, well, nicely, the\n" . |
| 87 | | "grabber can retrieve data.\n\n"; |
| 88 | | |
| 89 | | $config->{niceness} = ask("Niceness? [default=5]"); |
| 90 | | $config->{niceness} ||= 5; |
| | 87 | $config->{option_ready} ||= '--version'; |
| | 88 | } |
| | 89 | |
| | 90 | print "\nCATEGORY: Data Quality\n\n" . |
| | 91 | "Rate the accuracy of the data $grabber fetches; i.e. how often it\n" . |
| | 92 | "can be relied upon to report the right programs in the right timeslots.\n" . |
| | 93 | "(This is a measure of the source $grabber relies upon rather than a\n". |
| | 94 | "a judgement of $grabber itself.)\n" . |
| | 95 | "(1) Guide data is often inaccurate\n" . |
| | 96 | "(2) Guide data is occasionally or sometimes inaccurate\n" . |
| | 97 | "(3) Guide data is 100% accurate, or very close to it\n\n"; |
| | 98 | |
| | 99 | $config->{quality} = ask_choice("Data quality?", 3, 1, 2, 3); |
| | 100 | |
| | 101 | #print "\nCATEGORY: Niceness\n\n" . |
| | 102 | # "NOTE: This metric will probably change, so don't sweat it for now.\n". |
| | 103 | # "Rate the niceness of $grabber. Niceness is a general score out\n" . |
| | 104 | # "of 10 for how quickly, efficiently, and, well, nicely, the\n" . |
| | 105 | # "grabber can retrieve data.\n\n"; |
| | 106 | # |
| | 107 | #$config->{niceness} = ask("Niceness? [default=5]"); |
| | 108 | #$config->{niceness} ||= 5; |
| 137 | | $s = ask_boolean("Can $grabber fetch a single channel of data only? "); |
| 138 | | |
| 139 | | if ($s) |
| 140 | | { |
| 141 | | $g .= 'c'; |
| 142 | | print "\nWhat option needs to be sent to $grabber to specify\n" . |
| 143 | | "the channels wanted? For example, if $grabber can be\n" . |
| 144 | | "instructed to fetch data for channels Seven and Nine by\n" . |
| 145 | | "the option \"--channels Seven,Nine\", enter \"--channels\".\n\n"; |
| 146 | | |
| 147 | | $config->{option_channels} = ask("Command-line option for channels? " . |
| 148 | | "[default=--channels]"); |
| 149 | | $config->{option_channels} ||= '--channels'; |
| 150 | | } |
| 151 | | |
| 152 | | $config->{granularity} = $g; |
| 153 | | |
| 154 | | print "\nCATEGORY: Caching\n\n" . |
| 155 | | "Some grabbers use an internal cache, to avoid re-fetching data.\n\n"; |
| 156 | | |
| 157 | | $config->{cache} = ask_boolean("Does $grabber use an internal cache?"); |
| 158 | | |
| 159 | | if ($config->{cache}) |
| 160 | | { |
| 161 | | |
| 162 | | print "\nSome grabbers are able to run in \"cheap\" mode, which\n" . |
| 163 | | "means they verify and return their internal cache without\n" . |
| 164 | | "fetching many web pages or taking too long to run.\n\n"; |
| 165 | | $config->{cheap_mode} = ask_boolean("Does $grabber have a \"cheap\" mode?"); |
| 166 | | if ($config->{cheap_mode}) |
| 167 | | { |
| 168 | | $config->{option_cheap} = ask("\nWhat option enables this \"cheap\" " . |
| 169 | | "mode? [default=--cheap]"); |
| 170 | | $config->{option_cheap} ||= '--cheap'; |
| 171 | | } |
| 172 | | |
| 173 | | # Possibly ask a question about cache verification |
| 174 | | } |
| | 174 | # I think we'll rewrite channels.conf to simulate this for all grabbers |
| | 175 | # (or rather, write temporary channels.conf files). |
| | 176 | # |
| | 177 | #$s = ask_boolean("Can $grabber fetch a single channel of data only? "); |
| | 178 | # |
| | 179 | #if ($s) |
| | 180 | #{ |
| | 181 | # $g .= 'c'; |
| | 182 | # print "\nWhat option needs to be sent to $grabber to specify\n" . |
| | 183 | # "the channels wanted? For example, if $grabber can be\n" . |
| | 184 | # "instructed to fetch data for channels Seven and Nine by\n" . |
| | 185 | # "the option \"--channels Seven,Nine\", enter \"--channels\".\n\n"; |
| | 186 | # |
| | 187 | # $config->{option_channels} = ask("Command-line option for channels? " . |
| | 188 | # "[default=--channels]"); |
| | 189 | # $config->{option_channels} ||= '--channels'; |
| | 190 | #} |
| | 191 | # |
| | 192 | #$config->{granularity} = $g; |
| | 193 | |
| | 194 | if ($config->{category} == 1) |
| | 195 | { |
| | 196 | print "\nCATEGORY: Verified Caching\n\n" . |
| | 197 | "Category 1 grabbers often have an internal cache. They can use this\n" . |
| | 198 | "to greatly reduce the amount of downloads necessary, by returning the\n" . |
| | 199 | "cached data rather than fetching it anew. An important part of this\n" . |
| | 200 | "process is verification, or checking to make sure that the schedule\n" . |
| | 201 | "hasn't changed significantly from the cache.\n\n"; |
| | 202 | |
| | 203 | $config->{cache} = ask_boolean("Can $grabber reduce downloads by through verified caching?", 1); |
| | 204 | } |
| | 205 | |
| | 206 | # I think this is no longer needed because Shepherd will keep track of |
| | 207 | # what's in the cache, yes? |
| | 208 | # |
| | 209 | # |
| | 210 | #if ($config->{cache}) |
| | 211 | #{ |
| | 212 | # |
| | 213 | # print "\nSome grabbers are able to run in \"cheap\" mode, which\n" . |
| | 214 | # "means they verify and return their internal cache without\n" . |
| | 215 | # "fetching many web pages or taking too long to run.\n\n"; |
| | 216 | # $config->{cheap_mode} = ask_boolean("Does $grabber have a \"cheap\" mode?"); |
| | 217 | # if ($config->{cheap_mode}) |
| | 218 | # { |
| | 219 | # $config->{option_cheap} = ask("\nWhat option enables this \"cheap\" " . |
| | 220 | # "mode? [default=--cheap]"); |
| | 221 | # $config->{option_cheap} ||= '--cheap'; |
| | 222 | # } |
| | 223 | # |
| | 224 | #} |