maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Search for a widget Soccer (https://talk.maemo.org/showthread.php?t=46193)

Dr.MZ 2010-03-01 13:55

Search for a widget Soccer/football
 
Is there a widget that can display the latest soccer/football matches for the respective leagues of the countries (for exemble Bundesliga, Primera División, Serie A and Premier League) on the desktop. It should always display the current match and the selected league match at the work itself as a kind of live ticker.

Is there something like this or has someone the opportunity to make an app for it.
I think I'm not the only one who so desires a widget!

noobmonkey 2010-03-01 13:58

Re: Search for a widget Soccer
 
Soccer, whats this soccer you talk about? Hehehehe :D :D
Would be quite a cool widget, and would get busy at the weekends :D

Dr.MZ 2010-03-01 14:10

Re: Search for a widget Soccer
 
Soccer/football is one of the most beautiful things in the world, next .... :rolleyes:

And it's time that it will also pave the way to the N900!!!

noobmonkey 2010-03-01 14:13

Re: Search for a widget Soccer
 
ohhhhhhhhhhhhh you mean Football! ;) Gotcha ;)

Dr.MZ 2010-03-01 14:22

Re: Search for a widget Soccer
 
Yes, soocer = football

noobmonkey 2010-03-01 14:27

Re: Search for a widget Soccer
 
almost, soccer =americanised version of the game football :) their football is a game with helmets, and they throw the ball random!

Dr.MZ 2010-03-01 14:34

Re: Search for a widget Soccer
 
I mean this: http://en.wikipedia.org/wiki/Association_football

BoeMatic 2010-03-01 14:49

Re: Search for a widget Soccer
 
I was thinking about a widget that queries http://www.livescores.com/ (or similar) an shows the result according to your settings.


Unfortunately i'm not much of a programmer, I only understand PHP a little bit :)

krk969 2010-03-01 14:59

Re: Search for a widget Soccer
 
wap.scorespro.com
not a widget but you could try that on your browser

if anybody knows of an xml feed that provides the team list and scores let me know and it will be very trivial to come up with a simple widget for this.

Dr.MZ 2010-03-01 15:00

Re: Search for a widget Soccer
 
Yes something like this, I think, though, only select the league in each of which can be displayed.

freppas 2010-03-01 15:05

Re: Search for a widget Soccer
 
Sounds cool, and since the app will hopefully be open source I can change it o be called just "Football", as it should be ;)

cashclientel 2010-03-01 15:40

Re: Search for a widget Soccer
 
There's an RSS desktop widget in the maemo repos, so you could subscribe to the BBC football news feeds. I don't think they do international leagues on the feed but champ league, etc should be there:

http://news.bbc.co.uk/sport1/hi/help/rss/default.stm

I'm not sure which one has the scores on them as I can't see back but one of them must (I see 4 football ones).

smegheadz 2010-03-01 15:41

Re: Search for a widget Soccer
 
wud be nice to have the team form or betting odd's, sites like soccerway or soccerstats are good for stats and soccerway can show the odds too. bet365 use betradar for their team/games stats prematch, wonder if theres a way to use that.

liverpool smell :-p

Dr.MZ 2010-03-13 13:13

Re: Search for a widget Soccer
 
There are now married to someone who has such a widget? For the work with the RSS feed, but is still not as good as a true widget which will be used exclusively for football.

tomster 2010-03-13 13:56

Re: Search for a widget Soccer
 
For German Bundesliga I use this feed:
http://www.victipp.de/rss/liveerg_1bl_rss20.xml

But also the feeds from www.kicker.de are recommended.

You do lose track though when having Bundesliga, Champions League and other feeds subscribed. The widget's window gets preety messed up.

But a dedicated widget would be much nicer, in deed!

dhester 2010-03-13 14:53

Re: Search for a widget Soccer
 
A widget is needed urgently or I will have to exchange my N900 for an iphone!

sine220 2010-03-13 16:16

Re: Search for a widget Soccer
 
the sky sports score centre feed works really well...over 3g and wifi....this will be more than sufficient for me until an app is made

m2cm2c 2010-03-13 17:14

Re: Search for a widget Soccer
 
I'm working on a python widget for this, but I'm "not" promising anything yet, also can you please say what type of matches or leagues you'ld like to follow, ... etc :)

torres76 2010-03-13 21:14

Re: Search for a widget Soccer
 
Quote:

Originally Posted by m2cm2c (Post 566152)
I'm working on a python widget for this, but I'm "not" promising anything yet, also can you please say what type of matches or leagues you'ld like to follow, ... etc :)

The english premier league plz. world cup, champions league, europa cup.

dhester 2010-03-13 22:54

Re: Search for a widget Soccer
 
English championship, so I can follow the Reading scores this season, and then premiership next season!!!

Dosenblech 2010-03-13 23:06

Re: Search for a widget Soccer
 
Quote:

Originally Posted by m2cm2c (Post 566152)
I'm working on a python widget for this, but I'm "not" promising anything yet, also can you please say what type of matches or leagues you'ld like to follow, ... etc :)

it would be great! :)
- for me, the best leagues in europe ;) ...the german bundesliga

Dr.MZ 2010-03-14 01:09

Re: Search for a widget Soccer
 
Quote:

Originally Posted by m2cm2c (Post 566152)
I'm working on a python widget for this, but I'm "not" promising anything yet, also can you please say what type of matches or leagues you'ld like to follow, ... etc :)

This is super! :D:D:D:D:D
Have you got a name for the widget, so we already know how to program, we will soon have to look?

Deutsche Bundesliga, Europa League and Champions League

m2cm2c 2010-03-14 04:01

Re: Search for a widget Soccer
 
Quote:

Originally Posted by Dr.MZ (Post 566485)
Da klingt super. :D:D:D:D:D:D:D
Hast du schon einen Namen für das Widget, damit wir jetzt schon wissen nach welchem Programm wir demnächst schauen müssen?

Deutsche Bundesliga, Europa League und Champions League

dude I have no idea what you just said but I got the part about Bundesliga, Europa League and Champions League :D

ok, so far so good :)
this is some of what my python script will retrieve for you:


14:30 VFL Bochum V.S. BV Borussia Dortmund score: 1:4
14:30 FSV Mainz 05 V.S. FC Kln score: 1:0
17:30 Bayern Munich V.S. SC Freiburg score: 2:1
Sunday 14 Mar 2010
14:30 TSG Hoffenheim V.S. SV Werder Bremen score: --:--
16:30 Bayer 04 Leverkusen V.S. Hamburger SV score: --:--
Friday 19 Mar 2010
19:30 FC Kln V.S. Borussia Munchen Gladbach score: --:--


now I'll have to add an interface and some options to select which match and time ..etc

this will take a little while for it to be complete. I'll keep you updated of its success, time to go to bed ! :D

Dr.MZ 2010-03-14 09:09

Re: Search for a widget Soccer
 
Sorry, out of sheer joy, I completely forgot to write in English too!
So i changed it but now that does not create problems.

m2cm2c 2010-03-14 17:11

Re: Search for a widget Soccer
 
1 Attachment(s)
here's how the widget looks so far, I'll add some coloring to make it clearer later.

Dosenblech 2010-03-14 18:19

Re: Search for a widget Soccer
 
it's not a good example! ;-)
I'm a fan of HSV...

- but the widget seems to be very nice!!!
by the way...the final result was 4:2 :-/

Dr.MZ 2010-03-14 23:02

Re: Search for a widget Soccer
 
Looks very good times already and I can not wait until it is found in the program catalog. Good work!

Bazza 2010-03-14 23:39

Re: Search for a widget Soccer
 
Quote:

Originally Posted by m2cm2c (Post 566967)
here's how the widget looks so far, I'll add some coloring to make it clearer later.

Looks good, i'll be keeping my eye on this project.

Can these be implemented into the application?

all english main leagues and cups

premier league
championship
division 1
division 2
FA cup
league cup

champions league
europa league

and if poss all european leagues and world cup and euro 2012 qualifying

basically all football :D:D:D:D:D

m2cm2c 2010-03-15 06:06

Re: Search for a widget Soccer
 
1 Attachment(s)
heres the widget so far,

to start it, cd to the containing directory and then do:
python SoccerSucker.py

when it starts up click on the options button
set the event (this will take a few seconds to process)
if it gets a little buggy select the event again and it should get fixed
then the date
then the match
and It'll keep track of that match

these are some of the events you can select matches from :

UEFA Champions League
UEFA Europa League
FA Cup
Norway Super Cup
Russian League Division 1
Swedish Super Cup
Russia Super Cup
European Championship QualifiersDraw results
Latvia 1 Division
Italian Calcio League A
Spanish League Primera Div. 1
English Premier League
German Bundesliga 1st Div.
French League 1st Div.
Portugal SuperLiga
Holland Eredivisie League
Turkey Super Ligi
Scotland Premier League
Russian Premier League
Greek National League A
Croatia 1.NHL League
Czech Gambrinus League
Belgium Exqi League
Romania Divizia A
Italian Calcio League B
Swiss Super League
German Bundesliga 2nd Div.
French League 2nd Div.
English League Div. 1
Baltic League
Austria Bundesliga
Slovenia - 1. Liga
Wales Premier League
Cyprus 1st Div. League
Bosnia & Herzegovina Premier League
German Bundesliga 3rd Div.
Denmark SAS-Ligaen

.... and many more


get it from here
http://talk.maemo.org/showpost.php?p...2&postcount=33

it'll look like this when all your settings are done:

clownzee 2010-03-15 06:21

Re: Search for a widget Soccer
 
OMG! awesome app..kudos to you!

BoeMatic 2010-03-15 09:10

Re: Search for a widget Soccer
 
Ohh that is amazing :D

Dr.MZ 2010-03-15 18:22

Re: Search for a widget Soccer
 
Since I'm using Python and programming in general is not at all versed a few questions about it.
Have so far only rootsh installed. I need something else for this and if so what exactly?
And if I script in X-terminal type will then automatically creates a program that I can later uninstall again without problems? Or you put it to Donwload anzubiten still in the program catalog for later updates?

m2cm2c 2010-03-15 18:34

Re: Search for a widget Soccer
 
1 Attachment(s)
Quote:

Originally Posted by Dr.MZ (Post 568158)
Since I'm using Python and programming in general is not at all versed a few questions about it.
Have so far only rootsh installed. I need something else for this and if so what exactly?
And if I script in X-terminal type will then automatically creates a program that I can later uninstall again without problems? Or you put it to Donwload anzubiten still in the program catalog for later updates?

you don't need root privileges to run the script
just unpack the compressed file and put it in your phone
or copy/paste the script I've provided here and save it as SoccerSucker.py
cd to the directory which contains the script
then run it but typing
python SoccerSucker.py
it will show on your 1st desktop as a widget
when you're done just close the terminal again.


also I've found a problem with the script that was causing it not to update the match score
here is the fixed script:


Code:

import sgmllib
class MyParser(sgmllib.SGMLParser):
        def parse(self, s):
                self.feed(s)
                self.close()
        def __init__(self, verbose=0):
                sgmllib.SGMLParser.__init__(self, verbose)
                self.hyperlinks = []
                self.descriptions = []
                self.inside_a_element = 0
                self.starting_description = 0
        def start_a(self, attributes):
                for name, value in attributes:
                        if name == "href":
                                self.hyperlinks.append(value)
                                self.inside_a_element = 1
                                self.starting_description = 1
        def end_a(self):
                self.inside_a_element = 0
        def handle_data(self, data):
                if self.inside_a_element:
                        if self.starting_description:
                                self.descriptions.append(data)
                                self.starting_description = 0
                        else:
                                self.descriptions[-1] += data
        def get_hyperlinks(self):
                return self.hyperlinks
        def get_descriptions(self):
                return self.descriptions
import urllib, sgmllib
events=['UEFA Champions League', 'main.aspx?c=4723', 'UEFA Europa League', 'main.aspx?c=4724', 'FA Cup', 'main.aspx?c=5235', 'Norway Super Cup', 'main.aspx?c=5018', 'Russian League Division 1', 'main.aspx?c=5164', 'Swedish Super Cup', 'main.aspx?c=5412', 'Russia Super Cup', 'main.aspx?c=873', 'European Championship QualifiersDraw results', 'main.aspx?c=5705', 'Latvia 1 Division', 'main.aspx?c=5304', 'Italian Calcio League A', 'main.aspx?c=4616', 'Spanish League Primera Div. 1', 'main.aspx?c=4848', 'English Premier League', 'main.aspx?c=4730', 'German Bundesliga 1st Div.', 'main.aspx?c=4821', 'French League 1st Div.', 'main.aspx?c=4727', 'Portugal SuperLiga', 'main.aspx?c=4852', 'Holland Eredivisie League', 'main.aspx?c=4735', 'Turkey Super Ligi', 'main.aspx?c=4851', 'Scotland Premier League', 'main.aspx?c=4810', 'Russian Premier League', 'main.aspx?c=5015', 'Greek National League A', 'main.aspx?c=4853', 'Croatia 1.NHL League', 'main.aspx?c=4858', 'Czech Gambrinus League', 'main.aspx?c=4814', 'Belgium Exqi League', 'main.aspx?c=4816', 'Romania Divizia A', 'main.aspx?c=4855', 'Italian Calcio League B', 'main.aspx?c=4646', 'Swiss Super League', 'main.aspx?c=4699', 'German Bundesliga 2nd Div.', 'main.aspx?c=4822', 'French League 2nd Div.', 'main.aspx?c=4728', 'English League Div. 1', 'main.aspx?c=4736', 'Baltic League', 'main.aspx?c=5029', 'Austria Bundesliga', 'main.aspx?c=4722', 'Slovenia - 1. Liga', 'main.aspx?c=4783', 'Wales Premier League', 'main.aspx?c=4833', 'Cyprus 1st Div. League', 'main.aspx?c=4856', 'Bosnia & Herzegovina Premier League', 'main.aspx?c=4857', 'German Bundesliga 3rd Div.', 'main.aspx?c=4826', 'Denmark SAS-Ligaen', 'main.aspx?c=4747', 'Hungary NB1 League', 'main.aspx?c=4854', 'Finland Ykkonen League Div. 1', 'main.aspx?c=5163', 'Ukraine Vischaya League', 'main.aspx?c=4813', 'Estonia Meistriliiga', 'main.aspx?c=5740', 'Belgium League 2e Klasse', 'main.aspx?c=4817', 'Bulgaria Premier League', 'main.aspx?c=4887', 'Scotland Division 2', 'main.aspx?c=4831', 'Slovenia - 2. Liga', 'main.aspx?c=4909', 'Serbia 1.SFL', 'main.aspx?c=4815', 'Montenegro First League', 'main.aspx?c=4888', 'Poland I Liga', 'main.aspx?c=4872', 'Ireland Premier League', 'main.aspx?c=5805', 'Ireland 1st Division League', 'main.aspx?c=5806', 'Belarus Premier League', 'main.aspx?c=5741', 'French League National', 'main.aspx?c=4898', 'Italian League C1A', 'main.aspx?c=4941', 'Italian League C1 B', 'main.aspx?c=4942', 'Scotland Division 3', 'main.aspx?c=4832', 'Germany Regional League - North', 'main.aspx?c=4823', 'Germany Regional League - West', 'main.aspx?c=4824', 'Germany Regional League - South', 'main.aspx?c=4825', 'English Football League Trophy', 'main.aspx?c=5273', 'English League Division 4', 'main.aspx?c=4910', 'Spanish League 2nd Div.', 'main.aspx?c=4901', 'English League Div. 2', 'main.aspx?c=4737', 'English League Div. 3', 'main.aspx?c=4738', 'Denmark Division 2 West League', 'main.aspx?c=5176', 'Denmark Division 2 East League', 'main.aspx?c=5177', 'Denmark Division 1 League', 'main.aspx?c=4748', 'Finland Veikkausliiga League', 'main.aspx?c=5698', 'Greek National League B', 'main.aspx?c=5067', 'Swiss Challenge League', 'main.aspx?c=4829', 'Austria Erste Division', 'main.aspx?c=4729', 'Albania Super League', 'main.aspx?c=5030', 'Turkey Super Ligi 2', 'main.aspx?c=4891', 'Scotland Division 1', 'main.aspx?c=4830', 'Slovakia 1. Liga', 'main.aspx?c=4779', 'Iceland Premier League', 'main.aspx?c=5699', 'Italy Serie A - Futsal', 'main.aspx?c=4933', 'Macedonia First League', 'main.aspx?c=4889', 'Holland League 2nd Div.', 'main.aspx?c=4850', 'Norway Tippeligaen', 'main.aspx?c=5688', 'Norway Division 1 League', 'main.aspx?c=5689', 'Portugal 2.Liga', 'main.aspx?c=4902', 'Swedish League Superettan', 'main.aspx?c=5686', 'Swedish League Allsvenskan', 'main.aspx?c=5687', 'Swedish League Division 1 South', 'main.aspx?c=5720', 'Swedish League Division 1 North', 'main.aspx?c=5721', 'FA Womens Cup', 'main.aspx?c=5730', 'German DFB Pokal', 'main.aspx?c=4819', 'French League Cup', 'main.aspx?c=4849', 'Spain Copa del Rey', 'main.aspx?c=4978', 'Italian Cup', 'main.aspx?c=4883', 'FA of Ireland Cup', 'main.aspx?c=4689', 'UEFA European U-21 Qualifiers', 'main.aspx?c=4313', 'UEFA European U-19 Qualifiers', 'main.aspx?c=5162', 'UEFA Women Champions League', 'main.aspx?c=4759', 'French Cup', 'main.aspx?c=5381', 'Scotland - FA Cup', 'main.aspx?c=5316', 'Turkey Cup', 'main.aspx?c=5260', 'Wales FA Cup', 'main.aspx?c=5315', 'Bulgaria Cup', 'main.aspx?c=5425', 'Cyprus Cup', 'main.aspx?c=5429', 'English FA Trophy', 'main.aspx?c=5317', 'Futsal Spanish League', 'main.aspx?c=5148', 'UEFA European U-17 Qualifiers', 'main.aspx?c=5149', 'Czech Cup', 'main.aspx?c=4998', 'KNVB Beker', 'main.aspx?c=5000', 'Romania Cup', 'main.aspx?c=5045', 'Portugal Cup', 'main.aspx?c=5170', 'Portugal League Cup', 'main.aspx?c=4879', 'Futsal Portugish League', 'main.aspx?c=5673', 'Poland Cup', 'main.aspx?c=5002', 'Macedonia Cup', 'main.aspx?c=5261', 'Wales Loosemores Challenge Cup', 'main.aspx?c=5040', 'Ukraine Cup', 'main.aspx?c=4929', 'Serbia and Montenegro Cup', 'main.aspx?c=5175', 'Slovakia Cup', 'main.aspx?c=5046', 'Scottish League Cup', 'main.aspx?c=4880', 'Russian Kubok Cup', 'main.aspx?c=4721', 'Slovenia Cup', 'main.aspx?c=5236', 'Switzerland Cup', 'main.aspx?c=5053', 'Belarus Cup', 'main.aspx?c=4930', 'Womens World Cup European Qualifiers', 'main.aspx?c=2686', 'Setanta Cup Ireland', 'main.aspx?c=5035', 'Belgium Cup', 'main.aspx?c=4956', 'Austrian Cup', 'main.aspx?c=4928', 'UEFA Futsal Cup', 'main.aspx?c=5669', 'Baltic Cup', 'main.aspx?c=5696', 'Finland League Cup', 'main.aspx?c=5658', 'Greece Cup', 'main.aspx?c=5258', 'Hungary League Cup', 'main.aspx?c=4890', 'Hungary Cup', 'main.aspx?c=5237', 'Croatia Cup', 'main.aspx?c=5001', 'Futsal Spanish Cup', 'main.aspx?c=5717', 'Denmark Cup', 'main.aspx?c=4961']
def plugin_core():
        global content_strings
        global content_links
        global content_links
        global date_index
        global team_index
        global times_index
        global times_strings
        global teams_by_date
        teams_by_date=[]
        content_strings=myparser.get_descriptions()
        content_links=myparser.get_hyperlinks()
        content_links=content_links[2:]
        date_index=[]
        team_index=[]
        times_index=[]
        times_strings=[]
        unwanted=["GMT"]
        for i, it in enumerate(content_strings):
                for dn in unwanted:
                        if dn in it:
                                content_links.insert(i,"")
        for i, it in enumerate(content_links):
                if ("main.aspx?team=" in it):
                        team_index.append(i)
                if ("?obo=true&obc=" in it):
                        content_strings.insert(i,"")
        days_strings=["Saturday","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"]
        for i, it in enumerate(content_strings):
                for dn in days_strings:
                        if dn in it:
                                date_index.append(i)
        i=0
        j=0
        while i<s.count("<td class=t>"):
                j=s.find("<td class=t>",j)+1
                times_index.append(j+11)
                i+=1
        i=0
       
        while i<len(times_index):
                times_strings.append((s[times_index[i]:times_index[i]+5]).replace("<",""))
                i+=1
        i=0
        j=0
        k=0
        l=""
        while i < len(team_index)-1 :
                if (j<len(date_index)):
                        if team_index[i]>date_index[j] :
                                teams_by_date.append(i)
                                j+=1
                i+=2
                k+=1
plugin_status=0
plugin_selector=0
ticker_started=0
timer_timeout=50000
import gtk
import hildondesktop
import hildon
class SoccerSuckerDialog(gtk.Dialog):
    def __init__(self):
        global content_strings
        global content_links
        global content_links
        global date_index
        global team_index
        global times_index
        global times_strings
        gtk.Dialog.__init__(self, "Options", None,
                            gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR)
        self.table=gtk.Table(3,4,True)
        self.selector=selector = populate_selector()
        button1 = gtk.Button("event")
        button2 = gtk.Button("match")
        button3 = gtk.Button("date")
        button1.connect("clicked",self.selected_event)
        button2.connect("clicked",self.selected_match)
        button3.connect("clicked",self.selected_date)
        self.table.attach(self.selector,0,3,0,3)
        self.table.attach(button1,3,4,0,1)
        self.table.attach(button3,3,4,1,2)
        self.table.attach(button2,3,4,2,3)
        self.set_size_request(800,300)       
        self.vbox.add(self.table)
        self.show_all()
    def selected_event(self,*args):
        global plugin_status
        self.table.remove(self.selector)       
        plugin_status=2
        self.selector=populate_selector()
        self.table.attach(self.selector,0,3,0,3)
        self.table.show_all()
        self.show_all()
    def selected_match(self,*args):
        global plugin_status
        self.table.remove(self.selector)       
        plugin_status=4
        self.selector=populate_selector()
        self.table.attach(self.selector,0,3,0,3)
        self.table.show_all()
        self.show_all()
    def selected_date(self,*args):
        global plugin_status
        self.table.remove(self.selector)       
        plugin_status=3
        self.selector=populate_selector()
        self.table.attach(self.selector,0,3,0,3)
        self.table.show_all()
        self.show_all()
def selection_changed(selector, user_data):
    global plugin_selector
    global myparser
    global current_teams
    global current_date
    global current_event
    current_selection = selector.get_active(0)
    if plugin_status==2:
        global s
        global f
        plugin_selector=current_selection
        current_event=current_selection
        f = urllib.urlopen("http://www.goalzz.com/"+events[plugin_selector*2+1])
        s = f.read()
          myparser = MyParser()
            myparser.parse(s)
            plugin_core()
    if (plugin_status==3):
        i=0
        current_teams=[]
        current_date=current_selection
        j=teams_by_date[current_selection]
        if current_selection==len(date_index)-1:
                while j < len(team_index)-1:
                        current_teams.append(content_strings[team_index[j]]+" V.S. "+content_strings[team_index[j+1]])
                        j+=2       
        else :
                while j < teams_by_date[current_selection+1]-1:
                        current_teams.append(content_strings[team_index[j]]+" V.S. "+content_strings[team_index[j+1]])
                        j+=2
    if plugin_status==4:
        plugin_selector=current_selection*2+teams_by_date[current_date]
        obj.set_button()
def populate_selector():
    selector = hildon.TouchSelector(text = True)
    selector.connect("changed", selection_changed)
    i=0
    if plugin_status==1:
        False       
    elif plugin_status==2:
        while i < len(events)-1 :
                selector.append_text(events[i])
                i+=2
    elif plugin_status==3:
        while i < len(date_index) :
                selector.append_text(content_strings[date_index[i]])
                i+=1
    elif plugin_status==4:
        while i < len(current_teams) :
                selector.append_text(current_teams[i])
                i+=1
    selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_SINGLE)
    return selector
def SoccerSuckerDialog_show(button):
    dialog = SoccerSuckerDialog()
    dialog.run()
    dialog.destroy()
class SoccerSuckerPlugin(hildondesktop.HomePluginItem):
    def __init__(self):
        hildondesktop.HomePluginItem.__init__(self)
        self.button = gtk.Button()
        self.set_button()
        self.button.connect("clicked", SoccerSuckerDialog_show)
        self.add(self.button)
    def ticker(self):
        self.button.hide_all()
        print "Refreshed"
        global s
        global myparser
        global f
        f = urllib.urlopen("http://www.goalzz.com/"+events[current_event*2+1])
        s = f.read()
          myparser = MyParser()
            myparser.parse(s)
            plugin_core()
        self.set_button()
        if plugin_status > 1:
                self.maintimer = gobject.timeout_add(timer_timeout, self.ticker)
    def set_button(self,*args):
        global plugin_status
        global ticker_started
        if plugin_status==0:
                label=gtk.Label("Options")
                self.button.add(label)
                plugin_status=1
        else :
                if ticker_started==0 :
                        self.maintimer = gobject.timeout_add(timer_timeout, self.ticker)
                        ticker_started=1
                self.remove(self.button)
                self.button = gtk.Button()
                self.button.connect("clicked", SoccerSuckerDialog_show)
                self.add(self.button)       
                self.button.show_all()
                table=gtk.Table(1,3,False)
                label=gtk.Label(times_strings[plugin_selector/2]+" ")
                label.modify_fg("normal",gtk.gdk.Color(red=0, green=0, blue=0, pixel=0))
                table.attach(label,0,1,0,1)
                label=gtk.Label(content_strings[team_index[plugin_selector]]+" V.S. "+content_strings[team_index[plugin_selector+1]])
                table.attach(label,1,2,0,1)
                label=gtk.Label(" score: "+content_strings[team_index[plugin_selector+1]-1])
                label.modify_fg("normal",gtk.gdk.Color(red=30000, green=0, blue=0, pixel=0))
                table.attach(label,2,3,0,1)
                self.button.add(table)
                self.button.show_all()
hd_plugin_type = SoccerSuckerPlugin
if __name__ == "__main__":
    import gobject
    gobject.type_register(hd_plugin_type)
    obj = gobject.new(hd_plugin_type, plugin_id="plugin_id")
    obj.show_all()
    gtk.main()


enjoy :D

Crude 2010-03-15 19:06

Re: Search for a widget Soccer
 
Brilliant little widget. If it's not asking too much, is it possible to expand this and view more than 1 match?
Also is it possible to get some live commentary feed. Brief commentary from livegoals.com or even better the commentary from goal.com. I know the commentary might be a hassle so the priority would be to view more than 1 match. I mean it already works so why not make it better :).

Thanks a lot again mate!

m2cm2c 2010-03-15 19:48

Re: Search for a widget Soccer
 
Quote:

Originally Posted by Crude (Post 568224)
Brilliant little widget. If it's not asking too much, is it possible to expand this and view more than 1 match?
Also is it possible to get some live commentary feed. Brief commentary from livegoals.com or even better the commentary from goal.com. I know the commentary might be a hassle so the priority would be to view more than 1 match. I mean it already works so why not make it better :).

Thanks a lot again mate!

Hey :D
I'm glad you like the widget,

you know you can open up each widget in its own terminal by issuing the command
osso-xterm "python SoccerSucker.py" as many times as you like ;) (thats if the widget is located in your /home/user folder), or else you'll need to put the full path of the widget there

then you'll have multiple widgets on your desktop each one following its own match :)

and for the commentary part.... I'll see what I can do about that, but I'm not promising anything :D

Dr.MZ 2010-03-15 20:36

Re: Search for a widget Soccer
 
Looks really great.
Nevertheless, I still had minor suggestions for improvement.
Also I would appreciate it if you get always shown a complete match. For example, 9 games each, with 4 and always displayed directly, the remainder obtained by scrolling.
Furthermore, it would not be bad if the current match will be displayed above.

So I could imagine it well to me.

http://s2b.directupload.net/images/100315/bgrhw3yp.jpg

asn900 2010-03-16 12:25

Re: Search for a widget Soccer
 
Great!!!
Thank you.
I signed only to say that.
If there is any possibility to get it like Dr.MZ wrote?

Kamikaze 2010-03-17 17:28

Re: Search for a widget Soccer
 
Many thanks m2cm2c for working on the script.

@ Dr.MZ - I'm confused, is that screenshot you posted just a mock up of how you would like the widget to look/function? Or is that a newer, more advanced script that hasn't been posted in this thread yet? It would be great if you could have more than one game or set it so that it followed all the games in a particular league that day.

Kamikaze 2010-03-17 21:33

Re: Search for a widget Soccer
 
I've just been trying this out with the Champions League games tonight. There's two games being played and I selected the Barcelona v Stuttgart game but for some reason it keeps on switching to the Bordeaux game (and sometimes back again). From what I can see when I go into the options to switch it back again the order of the two games in the list has switched. Does the script pick up the selected game by the number it is in the order of the list?

Bazza 2010-03-18 00:38

Re: Search for a widget Soccer
 
@Kamikaze

I'm not new to the phone but a complete noob to when it comes to scripts.

what do i open to type in the address of the file?

or

Better still what did you type to get it working and i will change the info accordingly to my phone setup.

Thanks in advance.


All times are GMT. The time now is 08:09.

vBulletin® Version 3.8.8