summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/community/mre/patch.diff
blob: 38a501a55faadee3af6cb4229805526debbbc7b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
--- ../mre-1.1.2/class/MythClient.php.original	2006-04-05 17:39:13.000000000 -0500
+++ ../mre-1.1.2/class/MythClient.php	2010-05-14 10:16:54.000000000 -0500
@@ -112,7 +112,7 @@
          return '0';
       }
       foreach($out as $line)
-         if(preg_match('/^Library API version: (.*)$/', $line, $matches))
+         if(preg_match('/^Library API *: (.*)$/', $line, $matches))
             return $matches[1];
       return '0';
    }
--- ../mre-1.1.2/conf/mre.conf.in.original	2006-08-13 16:48:57.000000000 -0500
+++ ../mre-1.1.2/conf/mre.conf.in	2010-05-04 00:25:26.000000000 -0500
@@ -28,9 +28,9 @@
 ; *** Application settings
 ; Unprivledged user to run as, if started as root
 ; This script will not run as root
-user = nobody
+user = mythtv
 ; Run MRE as daemon?  Requires pcntl_* functions built into PHP
-daemon = true
+daemon = false
 ; Number of minutes to sleep between runs
 sleep = 5
 ; Logging level (0 = normal, 1 = +error, 2 = +warning, 3 = +debug)
--- ../mre-1.1.2/class/EventFactory.php.original	2006-09-22 10:18:07.000000000 -0500
+++ ../mre-1.1.2/class/EventFactory.php	2010-08-28 00:02:37.000000000 -0500
@@ -50,7 +50,7 @@
                $obj = new NHLEvent($data['subtitle']); break;
             case 'MLB Baseball':
                $obj = new MLBEvent($data['subtitle']); break;
-            case 'NFL Football':
+            case ($data['title']=='NFL Football' || $data['title']=='NFL Preseason Football'):
                $obj = new NFLEvent($data['subtitle']); break;
             case 'College Football':
                $obj = new NCAAFEvent($data['subtitle']); break;
--- ../mre-1.1.2/class/MLBEvent.php.original	2006-11-05 17:06:57.000000000 -0600
+++ ../mre-1.1.2/class/MLBEvent.php	2010-08-28 00:02:37.000000000 -0500
@@ -27,7 +27,7 @@
    /**
     * URL to grab game info from
     */
-   const url = 'http://scores.espn.go.com/mlb/scoreboard';
+   const url = 'http://sports.espn.go.com/mlb/bottomline/scores';
 
    /**
     * Class constructor.
@@ -43,41 +43,25 @@
          trigger_error("Unable to generate valid search terms! [$gameInfo]", E_USER_WARNING);
       else
       {
-         $data = file(self::url);
-         $games = array();
-         if($data !== FALSE)
-         {
-            // Split the huge string into individual game data
-            foreach($data as $line)
-               if(preg_match('/\<div id="allGames".*\>.*/', $line))
-               {
-                  while(($loc = strrpos($line, 'teamTop')) !== FALSE)
-                  {
-                     $games[] = substr($line, $loc);
-                     $line = substr($line, 0, $loc);
-                  }
-                  break;
-               }
-            if(!sizeof($games))
-               trigger_error("Unable to find valid game data within source!", E_USER_WARNING);
-            foreach($criteria as $term)
-            {
-               foreach($games as $game)
-               {
-                  if(preg_match('/' . preg_quote($term) . '/', $game))
-                     if(preg_match('/teamTop.*\>(.*)\<\/td\>/U', $game, $matches))
-                     {
-                        $this->setStatus($matches[1]);
-                        if(preg_match('/^(Final|Postponed)/', $matches[1]))
-                           $this->setEventOver(TRUE);
-                        else
-                           $this->setEventOver(FALSE);
-                        $this->setValid(TRUE);
-                        break 2;
-                     }
-               }
+	 $data = file(self::url);
+         if($data)
+	 {
+	    $data_array=explode("&", $data[0]);
+	    foreach($data_array as $line)
+	    {
+	       $line=str_replace("%20", " ", $line);
+	       $line=str_replace("Chicago Sox", "Chicago White Sox", $line); #Program guide gives Chicago White Sox, website gives Chicago Sox 
+              if((strpos($line,$criteria[0]))&&(strpos($line,$criteria[1])))
+   	       {
+     		  if((strpos($line,'FINAL'))or(strpos($line,'Postponed'))) 
+ 		     $this->setEventOver(TRUE);
+  		  else
+  		     $this->setEventOver(FALSE);
+  		  $this->setValid(TRUE);
+  		  break;
+  	       }
             }
-         }
+	 }
       }
       if(!$this->isValid())
          trigger_error("Unable to find MLB info for '$gameInfo'!  The MLB parser may need to be updated.", E_USER_WARNING);
--- ../mre-1.1.2/class/NFLEvent.php.original	2006-11-05 17:06:57.000000000 -0600
+++ ../mre-1.1.2/class/NFLEvent.php	2010-08-28 00:06:56.000000000 -0500
@@ -27,7 +27,7 @@
    /**
     * URL to grab game info from
     */
-   const url = 'http://scores.espn.go.com/nfl/scoreboard';
+   const url = 'http://sports.espn.go.com/nfl/bottomline/scores';
 
    /**
     * Class constructor.
@@ -44,33 +44,23 @@
       else
       {
          $data = file(self::url);
-         $games = array();
-         if($data !== FALSE)
-         {
-            // Split the huge string into individual game data
-            foreach($data as $line)
-               if(preg_match('/\<td class="teamTop.*".*\>.*/', $line))
-                  $games[] = $line;
-            if(!sizeof($games))
-               trigger_error("Unable to find valid game data within source!", E_USER_WARNING);
-            foreach($criteria as $term)
-            {
-               foreach($games as $game)
-               {
-                  if(preg_match('/' . preg_quote($term) . '/', $game))
-                     if(preg_match('/teamTop.*\>(.*)\<\/td\>/U', $game, $matches))
-                     {
-                        $this->setStatus($matches[1]);
-                        if(preg_match('/^(Final|Postponed)/', $matches[1]))
-                           $this->setEventOver(TRUE);
-                        else
-                           $this->setEventOver(FALSE);
-                        $this->setValid(TRUE);
-                        break 2;
-                     }
-               }
-            }
-         }
+	 if($data)
+	 {
+	    $data_array=explode("&", $data[0]);	 
+	    foreach($data_array as $line)
+	    {
+	       $line=str_replace("%20", " ", $line);
+              if((strpos($line,$criteria[0]))&&(strpos($line,$criteria[1])))
+	       {
+		  if(strpos($line,'FINAL'))
+		     $this->setEventOver(TRUE);
+		  else
+		     $this->setEventOver(FALSE);
+		  $this->setValid(TRUE);
+		  break;
+	       }
+	    }
+	 }
       }
       if(!$this->isValid())
          trigger_error("Unable to find NFL info for '$gameInfo'!  The NFL parser may need to be updated.", E_USER_WARNING);
--- ../mre-1.1.2/class/NBAEvent.php.original	2006-11-05 17:06:57.000000000 -0600
+++ ../mre-1.1.2/class/NBAEvent.php	2010-08-28 00:09:50.000000000 -0500
@@ -27,7 +27,7 @@
    /**
     * URL to grab game info from
     */
-   const url = 'http://scores.espn.go.com/nba/scoreboard';
+   const url = 'http://sports.espn.go.com/nba/bottomline/scores';
 
    /**
     * Class constructor.
@@ -44,35 +44,23 @@
       else
       {
          $data = file(self::url);
-         if($data !== FALSE)
-            foreach($criteria as $term)
-            {
-               $status = '';
-               $i = 0;
-               while($i < sizeof($data))
-               {
-                  if(preg_match('/' . preg_quote($term) . '/', $data[$i]))
-                  {
-                     $status = $data[$i];
-                     break;
-                  }
-                  ++$i;
-               }
-               if($i == sizeof($data))
-                  --$i;
-
-               if(preg_match('/id.*clock"\>(.*)\<\/div/U', $data[$i], $match) ||
-                  preg_match('/id.*clock"\>(.*)\<\/div/U', $data[$i-1], $match))
-               {
-                  $this->setStatus($match[1]);
-                  if(preg_match('/^Final/', $match[1]))
-                     $this->setEventOver(TRUE);
-                  else
-                     $this->setEventOver(FALSE);
-                  $this->setValid(TRUE);
-                  break;
-               }
+         if($data)
+	 {
+	    $data_array=explode("&", $data[0]);
+            foreach($data_array as $line)
+	    {
+	       $line=str_replace("%20", " ", $line);
+              if((strpos($line,$criteria[0]))&&(strpos($line,$criteria[1])))
+  	       {
+       		  if(strpos($line,'FINAL')) 
+ 		     $this->setEventOver(TRUE);
+  		  else
+  		     $this->setEventOver(FALSE);
+  		  $this->setValid(TRUE);
+ 		  break;
+  	       }
             }
+         }
       }
       if(!$this->isValid())
          trigger_error("Unable to find NBA info for '$gameInfo'!  The NBA parser may need to be updated.", E_USER_WARNING);
--- ../mre-1.1.2/class/NHLEvent.php.original	2006-11-05 17:06:57.000000000 -0600
+++ ../mre-1.1.2/class/NHLEvent.php	2010-08-28 00:09:04.000000000 -0500
@@ -27,7 +27,7 @@
    /**
     * URL to grab game info from
     */
-   const url = 'http://scores.espn.go.com/nhl/scoreboard';
+   const url = 'http://sports.espn.go.com/nhl/bottomline/scores';
 
    /**
     * Class constructor.
@@ -39,32 +39,29 @@
       parent::__construct();
 
       $criteria = $this->generateSearchTerms($gameInfo);
+      
       if(!sizeof($criteria))
          trigger_error("Unable to generate valid search terms! [$gameInfo]", E_USER_WARNING);
       else
       {
          $data = file(self::url);
-         if($data !== FALSE)
-            foreach($criteria as $term)
-            {
-               $status = '';
-               foreach($data as $line)
-                  if(preg_match('/' . preg_quote($term) . '/', $line))
-                  {
-                     $status = $line;
-                     break;
-                  }
-               if(preg_match('/id.*st"\>(.*)\<\/td/U', $status, $match))
-               {
-                  $this->setStatus($match[1]);
-                  if(preg_match('/^Final/', $match[1]))
-                     $this->setEventOver(TRUE);
-                  else
-                     $this->setEventOver(FALSE);
-                  $this->setValid(TRUE);
-                  break;
-               }
+         if($data)
+	 {
+	    $data_array=explode("&", $data[0]);
+            foreach($data_array as $line)
+	    {
+	       $line=str_replace("%20", " ", $line);
+              if((strpos($line,$criteria[0]))&&(strpos($line,$criteria[1])))
+	       {
+		  if(strpos($line,'FINAL')) 
+		     $this->setEventOver(TRUE);
+		  else
+		     $this->setEventOver(FALSE);
+		  $this->setValid(TRUE);
+		  break;
+	       }
             }
+         }
       }
       if(!$this->isValid())
          trigger_error("Unable to find NHL info for '$gameInfo'!  The NHL parser may need to be updated.", E_USER_WARNING);