From jeffh at dundeemt.com Fri Apr 4 05:27:09 2008 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Thu, 3 Apr 2008 22:27:09 -0500 Subject: [omaha] Big News! Robin Dunn hired by UNMC Message-ID: <5aaed53f0804032027s71e7bef8r2c6747c448da67b8@mail.gmail.com> Now here is a little bit of fame and possibly a bit of good luck for us. Robin Dunn of wxPython fame has been hired on as a consultant by our friends over at UNMC. The link to his post is here: http://wxpython.org/blog/2008/04/03/tranquility-base-here-the-robin-has-landed/ I've already emailed him to ask him to speak at one of our meetings. If any of our UNMC friends would like to fill us in on any more of the details, I'm all ears -jeff -- Jeff Hinrichs Dundee Media & Technology, Inc jeffh at dundeemt.com 402.218.1473 From mike at hostetlerhome.com Fri Apr 4 14:43:34 2008 From: mike at hostetlerhome.com (Mike Hostetler) Date: Fri, 4 Apr 2008 07:43:34 -0500 Subject: [omaha] Big News! Robin Dunn hired by UNMC In-Reply-To: <5aaed53f0804032027s71e7bef8r2c6747c448da67b8@mail.gmail.com> References: <5aaed53f0804032027s71e7bef8r2c6747c448da67b8@mail.gmail.com> Message-ID: That is really cool! I know that UNMC does some Python/wxPython so I can't help but think they need something customized. I would love to hear him talk . . . On Apr 3, 2008, at 10:27 PM, Jeff Hinrichs - DM&T wrote: > Now here is a little bit of fame and possibly a bit of good luck for > us. Robin Dunn of wxPython fame has been hired on as a consultant by > our friends over at UNMC. The link to his post is here: > http://wxpython.org/blog/2008/04/03/tranquility-base-here-the-robin- > has-landed/ > > I've already emailed him to ask him to speak at one of our meetings. > > If any of our UNMC friends would like to fill us in on any more of the > details, I'm all ears > > -jeff > > -- > Jeff Hinrichs > Dundee Media & Technology, Inc > jeffh at dundeemt.com > 402.218.1473 > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org Mike Hostetler mike at hostetlerhome.com http://mike.hostetlerhome.com From jeffh at dundeemt.com Sat Apr 5 01:05:17 2008 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Fri, 4 Apr 2008 18:05:17 -0500 Subject: [omaha] Big News! Robin Dunn hired by UNMC In-Reply-To: References: <5aaed53f0804032027s71e7bef8r2c6747c448da67b8@mail.gmail.com> Message-ID: <5aaed53f0804041605q2fcd8d69p9805e54d92302fdf@mail.gmail.com> Robin said that I was the second one to bring up the possibility of speaking at a users group meeting. I'm not sure who the first one was but I'm guessing Matt H. Speaking of Matt -- I've been totally oblivious to the fact that he gave a presentation at PyCon 2006. http://wiki.python.org/moin/PyCon2006/Talks Matt has been to a couple of meetings. I wonder... Matt: Any chance you would like to speak at the next meeting? Topic of your choice. ;) -jeff On Fri, Apr 4, 2008 at 7:43 AM, Mike Hostetler wrote: > That is really cool! I know that UNMC does some Python/wxPython so I > can't help but think they need something customized. > > I would love to hear him talk . . . > > > On Apr 3, 2008, at 10:27 PM, Jeff Hinrichs - DM&T wrote: > > > Now here is a little bit of fame and possibly a bit of good luck for > > us. Robin Dunn of wxPython fame has been hired on as a consultant by > > our friends over at UNMC. The link to his post is here: > > http://wxpython.org/blog/2008/04/03/tranquility-base-here-the-robin- > > has-landed/ > > > > I've already emailed him to ask him to speak at one of our meetings. > > > > If any of our UNMC friends would like to fill us in on any more of the > > details, I'm all ears > > > > -jeff > > > > -- > > Jeff Hinrichs > > Dundee Media & Technology, Inc > > jeffh at dundeemt.com > > 402.218.1473 > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > Mike Hostetler > mike at hostetlerhome.com > http://mike.hostetlerhome.com > > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Jeff Hinrichs Dundee Media & Technology, Inc jeffh at dundeemt.com 402.218.1473 From jeffh at dundeemt.com Sun Apr 6 05:00:30 2008 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Sat, 5 Apr 2008 22:00:30 -0500 Subject: [omaha] Python Papers, Volume 3, Issue 1 Message-ID: <5aaed53f0804052000hfb480ccqb0babcc7355fa3ea@mail.gmail.com> If you haven't seen the Python Papers before you are missing out on a nice python publication. Don't forget, it's free! http://pythonpapers.blogspot.com/2008/04/python-papers-volume-3-issue-1-now.html -- jeff From elicriffield at gmail.com Tue Apr 8 18:31:14 2008 From: elicriffield at gmail.com (Eli Criffield) Date: Tue, 8 Apr 2008 11:31:14 -0500 Subject: [omaha] parsing JavaScript problem Message-ID: <18e3f33d0804080931j31ea209bvfe59d3f14e3b9302@mail.gmail.com> Short background actull problem below: MLB decided they should be the only ones allowed to stream baseball games online. And that its worth $14.95 for the privilege of listening to the audio. They also assume that everyone is using windows and have two different player options, Windows Media Player or Silverlight. Using mostly the same code i used for my Sirius online player (sipie) i fake i can fake i am a windows browser and login and get the stream url that can be feed to mplayer and then you can listen on Linux. What you need is the game ID to know what stream to request. This page has a chart of current games and links to there media player to listen to them. The links have the game id in them. http://mlb.mlb.com/mediacenter/index.jsp Although its a static page all the games are loaded via ajax after the html is loaded. AJAX would be super easy to parse, expect they forgot the XML part and have dynamically generated JavaScript that has all the info in it. That JavaScript is page here: http://mlb.mlb.com/components/game/year_2008/month_04/day_08/gamesbydate.jsp What i need to do is take data from that page and extract what i want. So here's the real problem. The JavaScript for a game is like this: { condensed_video: null, gameid: '2008/04/08/phimlb-nynmlb-1', teams: [{ isHome: false, runs: null, code: 'phi' }, { isHome: true, runs: null, code: 'nym' }], status: 'P', event_time: ' 1:10 PM', home_audio: { blackout: 'local', text: 'WFAN', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2.xsl', w_id: '620882', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432841', pid: 'mlb_ga', fid: 'h12', url: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2.xsl', id: '620882', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, away_audio: { blackout: 'local', text: 'WPHT', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2.xsl', w_id: '620884', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432842', pid: 'mlb_ga', fid: 'a12', url: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2.xsl', id: '620884', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, } I need to extract the team names (its after code:), who is playing at home, and the w_id of the home_audio and away_audio. Any ideas? Eli Criffield From JeffH at delasco.com Tue Apr 8 18:42:33 2008 From: JeffH at delasco.com (Jeff Hinrichs) Date: Tue, 8 Apr 2008 11:42:33 -0500 Subject: [omaha] parsing JavaScript problem In-Reply-To: <18e3f33d0804080931j31ea209bvfe59d3f14e3b9302@mail.gmail.com> Message-ID: <94BC3D204A17734681830A69CBF99993DF801C@lilo.delasco.pri> Looks like json to me. http://deron.meranda.us/python/comparing_json_modules/ #try demjson (pure python json decoder/encoder) import demjson json="""{ condensed_video: null, gameid: '2008/04/08/phimlb-nynmlb-1', teams: [{ isHome: false, runs: null, code: 'phi' }, { isHome: true, runs: null, code: 'nym' }], status: 'P', event_time: ' 1:10 PM', home_audio: { blackout: 'local', text: 'WFAN', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. xsl', w_id: '620882', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432841', pid: 'mlb_ga', fid: 'h12', url: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. xsl', id: '620882', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, away_audio: { blackout: 'local', text: 'WPHT', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. xsl', w_id: '620884', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432842', pid: 'mlb_ga', fid: 'a12', url: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. xsl', id: '620884', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, } """ pobj = demjson.decode(json) print pobj # even prettier import pprint pp = pprint.PrettyPrinter() pp.pprint(pobj) -j -----Original Message----- From: omaha-bounces at python.org [mailto:omaha-bounces at python.org] On Behalf Of Eli Criffield Sent: Tuesday, April 08, 2008 11:31 AM To: Omaha Python Users Group Subject: [omaha] parsing JavaScript problem Short background actull problem below: MLB decided they should be the only ones allowed to stream baseball games online. And that its worth $14.95 for the privilege of listening to the audio. They also assume that everyone is using windows and have two different player options, Windows Media Player or Silverlight. Using mostly the same code i used for my Sirius online player (sipie) i fake i can fake i am a windows browser and login and get the stream url that can be feed to mplayer and then you can listen on Linux. What you need is the game ID to know what stream to request. This page has a chart of current games and links to there media player to listen to them. The links have the game id in them. http://mlb.mlb.com/mediacenter/index.jsp Although its a static page all the games are loaded via ajax after the html is loaded. AJAX would be super easy to parse, expect they forgot the XML part and have dynamically generated JavaScript that has all the info in it. That JavaScript is page here: http://mlb.mlb.com/components/game/year_2008/month_04/day_08/gamesbydate .jsp What i need to do is take data from that page and extract what i want. So here's the real problem. The JavaScript for a game is like this: { condensed_video: null, gameid: '2008/04/08/phimlb-nynmlb-1', teams: [{ isHome: false, runs: null, code: 'phi' }, { isHome: true, runs: null, code: 'nym' }], status: 'P', event_time: ' 1:10 PM', home_audio: { blackout: 'local', text: 'WFAN', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. xsl', w_id: '620882', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432841', pid: 'mlb_ga', fid: 'h12', url: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. xsl', id: '620882', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, away_audio: { blackout: 'local', text: 'WPHT', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. xsl', w_id: '620884', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432842', pid: 'mlb_ga', fid: 'a12', url: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. xsl', id: '620884', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, } I need to extract the team names (its after code:), who is playing at home, and the w_id of the home_audio and away_audio. Any ideas? Eli Criffield _______________________________________________ Omaha Python Users Group mailing list Omaha at python.org http://mail.python.org/mailman/listinfo/omaha http://www.OmahaPython.org From JeffH at delasco.com Tue Apr 8 19:09:00 2008 From: JeffH at delasco.com (Jeff Hinrichs) Date: Tue, 8 Apr 2008 12:09:00 -0500 Subject: [omaha] parsing JavaScript problem In-Reply-To: <94BC3D204A17734681830A69CBF99993DF801C@lilo.delasco.pri> Message-ID: <94BC3D204A17734681830A69CBF99993DF801D@lilo.delasco.pri> should have mentioned, easy_install demjson -----Original Message----- From: omaha-bounces at python.org [mailto:omaha-bounces at python.org] On Behalf Of Jeff Hinrichs Sent: Tuesday, April 08, 2008 11:43 AM To: Omaha Python Users Group Subject: Re: [omaha] parsing JavaScript problem Looks like json to me. http://deron.meranda.us/python/comparing_json_modules/ #try demjson (pure python json decoder/encoder) import demjson json="""{ condensed_video: null, gameid: '2008/04/08/phimlb-nynmlb-1', teams: [{ isHome: false, runs: null, code: 'phi' }, { isHome: true, runs: null, code: 'nym' }], status: 'P', event_time: ' 1:10 PM', home_audio: { blackout: 'local', text: 'WFAN', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. xsl', w_id: '620882', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432841', pid: 'mlb_ga', fid: 'h12', url: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. xsl', id: '620882', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, away_audio: { blackout: 'local', text: 'WPHT', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. xsl', w_id: '620884', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432842', pid: 'mlb_ga', fid: 'a12', url: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. xsl', id: '620884', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, } """ pobj = demjson.decode(json) print pobj # even prettier import pprint pp = pprint.PrettyPrinter() pp.pprint(pobj) -j -----Original Message----- From: omaha-bounces at python.org [mailto:omaha-bounces at python.org] On Behalf Of Eli Criffield Sent: Tuesday, April 08, 2008 11:31 AM To: Omaha Python Users Group Subject: [omaha] parsing JavaScript problem Short background actull problem below: MLB decided they should be the only ones allowed to stream baseball games online. And that its worth $14.95 for the privilege of listening to the audio. They also assume that everyone is using windows and have two different player options, Windows Media Player or Silverlight. Using mostly the same code i used for my Sirius online player (sipie) i fake i can fake i am a windows browser and login and get the stream url that can be feed to mplayer and then you can listen on Linux. What you need is the game ID to know what stream to request. This page has a chart of current games and links to there media player to listen to them. The links have the game id in them. http://mlb.mlb.com/mediacenter/index.jsp Although its a static page all the games are loaded via ajax after the html is loaded. AJAX would be super easy to parse, expect they forgot the XML part and have dynamically generated JavaScript that has all the info in it. That JavaScript is page here: http://mlb.mlb.com/components/game/year_2008/month_04/day_08/gamesbydate .jsp What i need to do is take data from that page and extract what i want. So here's the real problem. The JavaScript for a game is like this: { condensed_video: null, gameid: '2008/04/08/phimlb-nynmlb-1', teams: [{ isHome: false, runs: null, code: 'phi' }, { isHome: true, runs: null, code: 'nym' }], status: 'P', event_time: ' 1:10 PM', home_audio: { blackout: 'local', text: 'WFAN', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. xsl', w_id: '620882', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432841', pid: 'mlb_ga', fid: 'h12', url: 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. xsl', id: '620882', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, away_audio: { blackout: 'local', text: 'WPHT', media_type: 'audio', urls: [{ blackout: 'local', speed: '12', url: { w: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. xsl', w_id: '620884', v: '2', login: 'Y', authorization: 'Y', mid: '200803172432842', pid: 'mlb_ga', fid: 'a12', url: 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. xsl', id: '620884', gid: '2008/04/08/phimlb-nynmlb-1' }, state: null }], is_free: false, state: 'audio_pregame' }, } I need to extract the team names (its after code:), who is playing at home, and the w_id of the home_audio and away_audio. Any ideas? Eli Criffield _______________________________________________ Omaha Python Users Group mailing list Omaha at python.org http://mail.python.org/mailman/listinfo/omaha http://www.OmahaPython.org _______________________________________________ Omaha Python Users Group mailing list Omaha at python.org http://mail.python.org/mailman/listinfo/omaha http://www.OmahaPython.org From jay at jays.net Tue Apr 8 19:15:17 2008 From: jay at jays.net (Jay Hannah) Date: Tue, 8 Apr 2008 12:15:17 -0500 (CDT) Subject: [omaha] Google Application Engine Message-ID: Whoah... Looks like I should learn Python this year? :) http://code.google.com/appengine/docs/whatisgoogleappengine.html Anyone played with this? j From mike at hostetlerhome.com Tue Apr 8 19:10:55 2008 From: mike at hostetlerhome.com (Mike Hostetler) Date: Tue, 8 Apr 2008 12:10:55 -0500 (CDT) Subject: [omaha] parsing JavaScript problem In-Reply-To: <94BC3D204A17734681830A69CBF99993DF801C@lilo.delasco.pri> References: <94BC3D204A17734681830A69CBF99993DF801C@lilo.delasco.pri> Message-ID: <32989.69.58.248.102.1207674655.squirrel@email.powweb.com> Ha! I was just working on the same thing, but Jeff beat me to it. It's for sure JSON.? >> import demjson >> mlb = demjson.decode( file('mlb.js').read()) >>> mlb['teams'][0] {u'code': u'phi', u'runs': None, u'isHome': False} >>> mlb['teams'][1] {u'code': u'nym', u'runs': None, u'isHome': True} Jeff Hinrichs wrote: > Looks like json to me. > http://deron.meranda.us/python/comparing_json_modules/ > > #try demjson (pure python json decoder/encoder) > import demjson > json="""{ > condensed_video: null, > gameid: '2008/04/08/phimlb-nynmlb-1', > teams: [{ > isHome: false, > runs: null, > code: 'phi' > }, { > isHome: true, > runs: null, > code: 'nym' > }], > status: 'P', > event_time: ' 1:10 PM', > home_audio: { > blackout: 'local', > text: 'WFAN', > media_type: 'audio', > urls: [{ > blackout: 'local', > speed: '12', > url: { > w: > 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. > xsl', > w_id: '620882', > v: '2', > login: 'Y', > authorization: 'Y', > mid: '200803172432841', > pid: 'mlb_ga', > fid: 'h12', > url: > 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. > xsl', > id: '620882', > gid: '2008/04/08/phimlb-nynmlb-1' > }, > state: null > }], > is_free: false, > state: 'audio_pregame' > }, > away_audio: { > blackout: 'local', > text: 'WPHT', > media_type: 'audio', > urls: [{ > blackout: 'local', > speed: '12', > url: { > w: > 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. > xsl', > w_id: '620884', > v: '2', > login: 'Y', > authorization: 'Y', > mid: '200803172432842', > pid: 'mlb_ga', > fid: 'a12', > url: > 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. > xsl', > id: '620884', > gid: '2008/04/08/phimlb-nynmlb-1' > }, > state: null > }], > is_free: false, > state: 'audio_pregame' > }, > } > """ > pobj = demjson.decode(json) > > print pobj > > # even prettier > import pprint > pp = pprint.PrettyPrinter() > pp.pprint(pobj) > > > > -j > -----Original Message----- > From: omaha-bounces at python.org [mailto:omaha-bounces at python.org] On > Behalf Of Eli Criffield > Sent: Tuesday, April 08, 2008 11:31 AM > To: Omaha Python Users Group > Subject: [omaha] parsing JavaScript problem > > Short background actull problem below: > > MLB decided they should be the only ones allowed to stream baseball > games online. And that its worth $14.95 for the privilege of listening > to the audio. They also assume that everyone is using windows and have > two different player options, Windows Media Player or Silverlight. > > Using mostly the same code i used for my Sirius online player (sipie) > i fake i can fake i am a windows browser and login and get the stream > url that can be feed to mplayer and then you can listen on Linux. What > you need is the game ID to know what stream to request. > > This page has a chart of current games and links to there media player > to listen to them. The links have the game id in them. > http://mlb.mlb.com/mediacenter/index.jsp > > Although its a static page all the games are loaded via ajax after the > html is loaded. AJAX would be super easy to parse, expect they forgot > the XML part and have dynamically generated JavaScript that has all > the info in it. > > That JavaScript is page here: > http://mlb.mlb.com/components/game/year_2008/month_04/day_08/gamesbydate > .jsp > > What i need to do is take data from that page and extract what i want. > > So here's the real problem. > The JavaScript for a game is like this: > > { > condensed_video: null, > gameid: '2008/04/08/phimlb-nynmlb-1', > teams: [{ > isHome: false, > runs: null, > code: 'phi' > }, { > isHome: true, > runs: null, > code: 'nym' > }], > status: 'P', > event_time: ' 1:10 PM', > home_audio: { > blackout: 'local', > text: 'WFAN', > media_type: 'audio', > urls: [{ > blackout: 'local', > speed: '12', > url: { > w: > 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. > xsl', > w_id: '620882', > v: '2', > login: 'Y', > authorization: 'Y', > mid: '200803172432841', > pid: 'mlb_ga', > fid: 'h12', > url: > 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. > xsl', > id: '620882', > gid: '2008/04/08/phimlb-nynmlb-1' > }, > state: null > }], > is_free: false, > state: 'audio_pregame' > }, > away_audio: { > blackout: 'local', > text: 'WPHT', > media_type: 'audio', > urls: [{ > blackout: 'local', > speed: '12', > url: { > w: > 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. > xsl', > w_id: '620884', > v: '2', > login: 'Y', > authorization: 'Y', > mid: '200803172432842', > pid: 'mlb_ga', > fid: 'a12', > url: > 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. > xsl', > id: '620884', > gid: '2008/04/08/phimlb-nynmlb-1' > }, > state: null > }], > is_free: false, > state: 'audio_pregame' > }, > } > > I need to extract the team names (its after code:), who is playing at > home, and the w_id of the home_audio and away_audio. > > Any ideas? > > Eli Criffield > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From elicriffield at gmail.com Tue Apr 8 19:56:45 2008 From: elicriffield at gmail.com (Eli Criffield) Date: Tue, 8 Apr 2008 12:56:45 -0500 Subject: [omaha] parsing JavaScript problem In-Reply-To: <32989.69.58.248.102.1207674655.squirrel@email.powweb.com> References: <94BC3D204A17734681830A69CBF99993DF801C@lilo.delasco.pri> <32989.69.58.248.102.1207674655.squirrel@email.powweb.com> Message-ID: <18e3f33d0804081056g36fffcbep344f0e40efa06ace@mail.gmail.com> This is why i love python! Thanks Eli Criffield On Tue, Apr 8, 2008 at 12:10 PM, Mike Hostetler wrote: > > > Ha! I was just working on the same thing, but Jeff beat me to it. > > It's for sure JSON. > > >> import demjson > >> mlb = demjson.decode( file('mlb.js').read()) > >>> > mlb['teams'][0] > {u'code': u'phi', u'runs': None, u'isHome': False} > >>> mlb['teams'][1] > {u'code': u'nym', u'runs': None, > u'isHome': True} > > > > > Jeff Hinrichs wrote: > > Looks > like json to me. > > > http://deron.meranda.us/python/comparing_json_modules/ > > > > #try demjson (pure python json decoder/encoder) > > import > demjson > > json="""{ > > condensed_video: > null, > > gameid: '2008/04/08/phimlb-nynmlb-1', > > > teams: [{ > > isHome: false, > > runs: > null, > > code: 'phi' > > }, { > > > isHome: true, > > runs: null, > > > code: 'nym' > > }], > > status: 'P', > > event_time: ' 1:10 PM', > > home_audio: { > > > blackout: 'local', > > text: 'WFAN', > > > media_type: 'audio', > > urls: [{ > > > blackout: 'local', > > speed: '12', > > > url: { > > w: > > > 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. > > xsl', > > w_id: '620882', > > > v: '2', > > login: 'Y', > > > authorization: 'Y', > > mid: > '200803172432841', > > pid: 'mlb_ga', > > > fid: 'h12', > > url: > > > 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. > > xsl', > > id: '620882', > > > gid: '2008/04/08/phimlb-nynmlb-1' > > > }, > > state: null > > }], > > is_free: false, > > state: 'audio_pregame' > > }, > > away_audio: { > > blackout: > 'local', > > text: 'WPHT', > > media_type: > 'audio', > > urls: [{ > > blackout: > 'local', > > speed: '12', > > > url: { > > w: > > > 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. > > xsl', > > w_id: '620884', > > > v: '2', > > login: 'Y', > > > authorization: 'Y', > > mid: > '200803172432842', > > pid: 'mlb_ga', > > > fid: 'a12', > > url: > > > 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. > > xsl', > > id: '620884', > > > gid: '2008/04/08/phimlb-nynmlb-1' > > > }, > > state: null > > }], > > is_free: false, > > state: 'audio_pregame' > > }, > > } > > """ > > pobj = > demjson.decode(json) > > > > print pobj > > > > > # even prettier > > import pprint > > pp = > pprint.PrettyPrinter() > > pp.pprint(pobj) > > > > > > > > -j > > -----Original Message----- > > > From: omaha-bounces at python.org [mailto:omaha-bounces at python.org] On > > Behalf Of Eli Criffield > > Sent: Tuesday, April 08, 2008 > 11:31 AM > > To: Omaha Python Users Group > > Subject: [omaha] > parsing JavaScript problem > > > > Short background actull > problem below: > > > > MLB decided they should be the only > ones allowed to stream baseball > > games online. And that its worth > $14.95 for the privilege of listening > > to the audio. They also > assume that everyone is using windows and have > > two different > player options, Windows Media Player or Silverlight. > > > > > Using mostly the same code i used for my Sirius online player (sipie) > > i fake i can fake i am a windows browser and login and get the > stream > > url that can be feed to mplayer and then you can listen > on Linux. What > > you need is the game ID to know what stream to > request. > > > > This page has a chart of current games and > links to there media player > > to listen to them. The links have > the game id in them. > > http://mlb.mlb.com/mediacenter/index.jsp > > > > Although its a static page all the games are loaded via > ajax after the > > html is loaded. AJAX would be super easy to > parse, expect they forgot > > the XML part and have dynamically > generated JavaScript that has all > > the info in it. > > > > That JavaScript is page here: > > > http://mlb.mlb.com/components/game/year_2008/month_04/day_08/gamesbydate > > .jsp > > > > What i need to do is take data from that > page and extract what i want. > > > > So here's the real > problem. > > The JavaScript for a game is like this: > > > > { > > condensed_video: null, > > gameid: > '2008/04/08/phimlb-nynmlb-1', > > teams: [{ > > > isHome: false, > > runs: null, > > > code: 'phi' > > }, { > > isHome: true, > > runs: null, > > code: 'nym' > > > }], > > status: 'P', > > event_time: ' 1:10 > PM', > > home_audio: { > > blackout: 'local', > > text: 'WFAN', > > media_type: 'audio', > > urls: [{ > > blackout: 'local', > > speed: '12', > > url: { > > w: > > > 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. > > xsl', > > w_id: '620882', > > > v: '2', > > login: 'Y', > > > authorization: 'Y', > > mid: > '200803172432841', > > pid: 'mlb_ga', > > > fid: 'h12', > > url: > > > 'http://web.servicebureau.net/conf/meta?i=1112976083&c=1234&m=was&u=/w2. > > xsl', > > id: '620882', > > > gid: '2008/04/08/phimlb-nynmlb-1' > > > }, > > state: null > > }], > > is_free: false, > > state: 'audio_pregame' > > }, > > away_audio: { > > blackout: > 'local', > > text: 'WPHT', > > media_type: > 'audio', > > urls: [{ > > blackout: > 'local', > > speed: '12', > > > url: { > > w: > > > 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. > > xsl', > > w_id: '620884', > > > v: '2', > > login: 'Y', > > > authorization: 'Y', > > mid: > '200803172432842', > > pid: 'mlb_ga', > > > fid: 'a12', > > url: > > > 'http://web.servicebureau.net/conf/meta?i=1112958329&c=1234&m=was&u=/w2. > > xsl', > > id: '620884', > > > gid: '2008/04/08/phimlb-nynmlb-1' > > > }, > > state: null > > }], > > is_free: false, > > state: 'audio_pregame' > > }, > > } > > > > I need to extract the team > names (its after code:), who is playing at > > home, and the w_id of > the home_audio and away_audio. > > > > Any ideas? > > > > > Eli Criffield > > > _______________________________________________ > > Omaha Python > Users Group mailing list > > Omaha at python.org > > > http://mail.python.org/mailman/listinfo/omaha > > > http://www.OmahaPython.org > > > _______________________________________________ > > Omaha Python > Users Group mailing list > > Omaha at python.org > > > http://mail.python.org/mailman/listinfo/omaha > > > http://www.OmahaPython.org > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From JeffH at delasco.com Tue Apr 8 21:03:03 2008 From: JeffH at delasco.com (Jeff Hinrichs) Date: Tue, 8 Apr 2008 14:03:03 -0500 Subject: [omaha] Google Application Engine In-Reply-To: Message-ID: <94BC3D204A17734681830A69CBF99993DF801E@lilo.delasco.pri> Not yet, just read some blog posts about it early this morning, I went and registered but no open slots currently so I'm on the waiting list ;( -----Original Message----- From: omaha-bounces at python.org [mailto:omaha-bounces at python.org] On Behalf Of Jay Hannah Sent: Tuesday, April 08, 2008 12:15 PM To: omaha-pm at pm.org; omaha at python.org; odynug at googlegroups.com Subject: [omaha] Google Application Engine Whoah... Looks like I should learn Python this year? :) http://code.google.com/appengine/docs/whatisgoogleappengine.html Anyone played with this? j _______________________________________________ Omaha Python Users Group mailing list Omaha at python.org http://mail.python.org/mailman/listinfo/omaha http://www.OmahaPython.org From jeff at taupro.com Tue Apr 8 21:03:32 2008 From: jeff at taupro.com (Jeff Rush) Date: Tue, 08 Apr 2008 14:03:32 -0500 Subject: [omaha] Google Application Engine In-Reply-To: <94BC3D204A17734681830A69CBF99993DF801E@lilo.delasco.pri> References: <94BC3D204A17734681830A69CBF99993DF801E@lilo.delasco.pri> Message-ID: <47FBC184.2050600@taupro.com> Jeff Hinrichs wrote: > Not yet, just read some blog posts about it early this morning, I went > and registered but no open slots currently so I'm on the waiting list ;( There is no waiting list for the documentation and downloadable SDK (including schema-less database engine). ;-) You can fire it up locally and do everything they show locally, and even host it yourself. Grab the download file, unpack it, and enter one command to have a sample guestbook app up and running on localhost:8080. Now change the Python source, HTML, or CSS and hit reload and you see your change. Makes for a very agile/iterative development style. -Jeff From JeffH at delasco.com Tue Apr 8 21:20:47 2008 From: JeffH at delasco.com (Jeff Hinrichs) Date: Tue, 8 Apr 2008 14:20:47 -0500 Subject: [omaha] Google Application Engine In-Reply-To: <47FBC184.2050600@taupro.com> Message-ID: <94BC3D204A17734681830A69CBF99993DF801F@lilo.delasco.pri> very true -- thanks for pointing that out. The dev methodology for GAE seems to be well thought out, local independent dev, versioned uploads, support for testing one version will keeping another live. nice. -----Original Message----- From: omaha-bounces at python.org [mailto:omaha-bounces at python.org] On Behalf Of Jeff Rush Sent: Tuesday, April 08, 2008 2:04 PM To: Omaha Python Users Group Subject: Re: [omaha] Google Application Engine Jeff Hinrichs wrote: > Not yet, just read some blog posts about it early this morning, I went > and registered but no open slots currently so I'm on the waiting list ;( There is no waiting list for the documentation and downloadable SDK (including schema-less database engine). ;-) You can fire it up locally and do everything they show locally, and even host it yourself. Grab the download file, unpack it, and enter one command to have a sample guestbook app up and running on localhost:8080. Now change the Python source, HTML, or CSS and hit reload and you see your change. Makes for a very agile/iterative development style. -Jeff _______________________________________________ Omaha Python Users Group mailing list Omaha at python.org http://mail.python.org/mailman/listinfo/omaha http://www.OmahaPython.org From newz at bearfruit.org Tue Apr 8 21:22:42 2008 From: newz at bearfruit.org (Matthew Nuzum) Date: Tue, 8 Apr 2008 14:22:42 -0500 Subject: [omaha] Google Application Engine In-Reply-To: References: Message-ID: On Tue, Apr 8, 2008 at 12:15 PM, Jay Hannah wrote: > > Whoah... Looks like I should learn Python this year? :) > > http://code.google.com/appengine/docs/whatisgoogleappengine.html > > Anyone played with this? > Oh, very cool. Too bad I didn't see this message until the end of my lunch break. Now I have to wait until tonight to try it. Very interesting security model. Maybe this will draw attention to python as a more universal web app language. -- Matthew Nuzum newz2000 on freenode From jeffh at dundeemt.com Wed Apr 9 04:12:58 2008 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Tue, 8 Apr 2008 21:12:58 -0500 Subject: [omaha] Google Application Engine In-Reply-To: References: Message-ID: <5aaed53f0804081912q77d00b35le3e0d72bfaf7d6ef@mail.gmail.com> Ok - so who else is dorking out and reading the docs right now? http://code.google.com/appengine/docs/ -jeff On Tue, Apr 8, 2008 at 2:22 PM, Matthew Nuzum wrote: > On Tue, Apr 8, 2008 at 12:15 PM, Jay Hannah wrote: > > > > Whoah... Looks like I should learn Python this year? :) > > > > http://code.google.com/appengine/docs/whatisgoogleappengine.html > > > > Anyone played with this? > > > > Oh, very cool. Too bad I didn't see this message until the end of my > lunch break. Now I have to wait until tonight to try it. > > Very interesting security model. Maybe this will draw attention to > python as a more universal web app language. > -- > Matthew Nuzum > newz2000 on freenode > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Jeff Hinrichs Dundee Media & Technology, Inc jeffh at dundeemt.com 402.218.1473 From elicriffield at gmail.com Wed Apr 9 05:13:01 2008 From: elicriffield at gmail.com (Eli Criffield) Date: Tue, 8 Apr 2008 22:13:01 -0500 Subject: [omaha] Google Application Engine In-Reply-To: <5aaed53f0804081912q77d00b35le3e0d72bfaf7d6ef@mail.gmail.com> References: <5aaed53f0804081912q77d00b35le3e0d72bfaf7d6ef@mail.gmail.com> Message-ID: <18e3f33d0804082013g1745f909h52a3825215a89b4e@mail.gmail.com> I finally get to set down and check it out. Its been a long day. Eli On Tue, Apr 8, 2008 at 9:12 PM, Jeff Hinrichs - DM&T wrote: > Ok - so who else is dorking out and reading the docs right now? > > http://code.google.com/appengine/docs/ > > -jeff > > > > On Tue, Apr 8, 2008 at 2:22 PM, Matthew Nuzum wrote: > > On Tue, Apr 8, 2008 at 12:15 PM, Jay Hannah wrote: > > > > > > Whoah... Looks like I should learn Python this year? :) > > > > > > http://code.google.com/appengine/docs/whatisgoogleappengine.html > > > > > > Anyone played with this? > > > > > > > Oh, very cool. Too bad I didn't see this message until the end of my > > lunch break. Now I have to wait until tonight to try it. > > > > Very interesting security model. Maybe this will draw attention to > > python as a more universal web app language. > > -- > > Matthew Nuzum > > newz2000 on freenode > > > > > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > > > > -- > Jeff Hinrichs > Dundee Media & Technology, Inc > jeffh at dundeemt.com > 402.218.1473 > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > From jeffh at dundeemt.com Wed Apr 9 05:31:51 2008 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Tue, 8 Apr 2008 22:31:51 -0500 Subject: [omaha] Google Application Engine In-Reply-To: <18e3f33d0804082013g1745f909h52a3825215a89b4e@mail.gmail.com> References: <5aaed53f0804081912q77d00b35le3e0d72bfaf7d6ef@mail.gmail.com> <18e3f33d0804082013g1745f909h52a3825215a89b4e@mail.gmail.com> Message-ID: <5aaed53f0804082031v3584d3d8q8aefaf3e3f4f55@mail.gmail.com> I read the docs while listening to the announcement at Campfire One. http://www.youtube.com/results?search_query=Google+App+Engine On Tue, Apr 8, 2008 at 10:13 PM, Eli Criffield wrote: > I finally get to set down and check it out. Its been a long day. > > Eli > > > > On Tue, Apr 8, 2008 at 9:12 PM, Jeff Hinrichs - DM&T wrote: > > Ok - so who else is dorking out and reading the docs right now? > > > > http://code.google.com/appengine/docs/ > > > > -jeff > > > > > > > > On Tue, Apr 8, 2008 at 2:22 PM, Matthew Nuzum wrote: > > > On Tue, Apr 8, 2008 at 12:15 PM, Jay Hannah wrote: > > > > > > > > Whoah... Looks like I should learn Python this year? :) > > > > > > > > http://code.google.com/appengine/docs/whatisgoogleappengine.html > > > > > > > > Anyone played with this? > > > > > > > > > > Oh, very cool. Too bad I didn't see this message until the end of my > > > lunch break. Now I have to wait until tonight to try it. > > > > > > Very interesting security model. Maybe this will draw attention to > > > python as a more universal web app language. > > > -- > > > Matthew Nuzum > > > newz2000 on freenode > > > > > > > > > _______________________________________________ > > > Omaha Python Users Group mailing list > > > Omaha at python.org > > > http://mail.python.org/mailman/listinfo/omaha > > > http://www.OmahaPython.org > > > > > > > > > > > -- > > Jeff Hinrichs > > Dundee Media & Technology, Inc > > jeffh at dundeemt.com > > 402.218.1473 > > > > > > _______________________________________________ > > Omaha Python Users Group mailing list > > Omaha at python.org > > http://mail.python.org/mailman/listinfo/omaha > > http://www.OmahaPython.org > > > _______________________________________________ > Omaha Python Users Group mailing list > Omaha at python.org > http://mail.python.org/mailman/listinfo/omaha > http://www.OmahaPython.org > -- Jeff Hinrichs Dundee Media & Technology, Inc jeffh at dundeemt.com 402.218.1473 web: www.dundeemt.com blog: inre.dundeemt.com From newz at bearfruit.org Wed Apr 9 05:47:21 2008 From: newz at bearfruit.org (Matthew Nuzum) Date: Tue, 8 Apr 2008 22:47:21 -0500 Subject: [omaha] Google Application Engine In-Reply-To: <5aaed53f0804081912q77d00b35le3e0d72bfaf7d6ef@mail.gmail.com> References: <5aaed53f0804081912q77d00b35le3e0d72bfaf7d6ef@mail.gmail.com> Message-ID: On Tue, Apr 8, 2008 at 9:12 PM, Jeff Hinrichs - DM&T wrote: > Ok - so who else is dorking out and reading the docs right now? > > http://code.google.com/appengine/docs/ > > -jeff I'm really impressed with the security model they have. It really shows some excellent engineering behind the scenes. I also like the authentication. Built in SSO as simple as : from google.appengine.api import users user = users.get_current_user() if user: self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, ' + user.nickname()) else: self.redirect(users.create_login_url(self.request.uri)) I'm only reading tonight but look forward to trying the code out. -- Matthew Nuzum newz2000 on freenode From jeffh at dundeemt.com Mon Apr 21 07:38:38 2008 From: jeffh at dundeemt.com (Jeff Hinrichs - DM&T) Date: Mon, 21 Apr 2008 00:38:38 -0500 Subject: [omaha] Only Python could import Soul Message-ID: <5aaed53f0804202238j6e3b98d4k259952f8344fe686@mail.gmail.com> http://xkcd.com/413/ -- Jeff Hinrichs Dundee Media & Technology, Inc jeffh at dundeemt.com 402.218.1473 web: www.dundeemt.com blog: inre.dundeemt.com aemechanic.googlecode.com