~ubuntu-branches/ubuntu/trusty/freeguide/trusty

« back to all changes in this revision

Viewing changes to src/freeguide/plugins/grabber/cosmostv/GrabberCosmostv.java

  • Committer: Bazaar Package Importer
  • Author(s): Shaun Jackman
  • Date: 2007-09-11 16:52:59 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070911165259-4r32oke21i1ezbmv
Tags: 0.10.5-1
* New upstream release.
* Update the watch file.
* Change Debian policy to version 3.7.2.2. No changes necessary.
* Add ant-optional to build dependencies. Closes: #441762.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
import java.util.TimeZone;
14
14
 
15
15
/**
16
 
 * DOCUMENT ME!
 
16
 * Grabber for http://cosmostv.com.
17
17
 *
18
 
 * @author $author$
19
 
 * @version $Revision: 1352 $
 
18
 * @author Alex Buloichik
20
19
 */
21
20
public class GrabberCosmostv extends BaseModule implements IModuleGrabber
22
21
{
23
22
    protected static final TimeZone TIMEZONE =
24
23
        TimeZone.getTimeZone( "Europe/Minsk" );
 
24
    protected static final String VALUE_ACCEPT_LANGUAGE = "ru";
 
25
    protected static final String VALUE_ACCEPT_CHARSET = "windows-1251";
 
26
    protected static final String URL = "http://www.cosmostv.com/schedule.asp";
 
27
    protected static final String CHANNELS_PREFIX = "cosmostv/";
25
28
 
26
29
    /**
27
30
     * DOCUMENT_ME!
62
65
    {
63
66
        HttpBrowser browser = new HttpBrowser(  );
64
67
 
65
 
        browser.setHeader( "Accept-Language", "ru" );
 
68
        browser.setHeader( 
 
69
            HttpBrowser.HEADER_ACCEPT_LANGUAGE, VALUE_ACCEPT_LANGUAGE );
66
70
 
67
 
        browser.setHeader( "Accept-Charset", "windows-1251" );
 
71
        browser.setHeader( 
 
72
            HttpBrowser.HEADER_ACCEPT_CHARSET, VALUE_ACCEPT_CHARSET );
68
73
 
69
74
        progress.setProgressMessage( 
70
75
            Application.getInstance(  ).getLocalizedMessage( "downloading" ) );
71
76
 
72
 
        logger.info( "Load initial page..." );
 
77
        logger.info( i18n.getString( "Logging.LoadList" ) );
73
78
 
74
79
        HandlerZips handlerZips = new HandlerZips(  );
75
80
 
76
 
        browser.loadURL( "http://www.cosmostv.com/schedule.asp" );
 
81
        browser.loadURL( URL );
77
82
 
78
83
        browser.parse( handlerZips );
79
84
 
80
85
        String[] zips = handlerZips.getZips(  );
81
86
 
82
 
        logger.info( "Load data files..." );
 
87
        logger.info( i18n.getString( "Logging.LoadData" ) );
83
88
 
84
 
        new ListTVParser( "cosmostv/", storage ).parseZips( 
 
89
        new ListTVParser( CHANNELS_PREFIX, storage ).parseZips( 
85
90
            zips, TIMEZONE, progress, logger );
86
91
    }
87
92
}