Module: Transfermarkt

Defined in:
lib/transfermarkt.rb,
lib/transfermarkt/club.rb,
lib/transfermarkt/league.rb,
lib/transfermarkt/player.rb,
lib/transfermarkt/version.rb,
lib/transfermarkt/entity_base.rb

Defined Under Namespace

Classes: Club, EntityBase, League, Player

Constant Summary collapse

USER_AGENT =
"Firefox"
VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.base_uriObject



14
15
16
# File 'lib/transfermarkt.rb', line 14

def Transfermarkt.base_uri
  "http://www.transfermarkt.com/"
end

.test_fetch_clubObject



27
28
29
30
# File 'lib/transfermarkt.rb', line 27

def self.test_fetch_club
  club_uri = "/en/maccabi-haifa/startseite/verein_1064.html"
  club = Transfermarkt::Club.fetch_by_club_uri(club_uri)
end

.test_fetch_leagueObject



18
19
20
21
22
23
24
25
# File 'lib/transfermarkt.rb', line 18

def self.test_fetch_league
  before = Time.now
  league_uri = "en/primera-division/startseite/wettbewerb_ES1.html"
  league = Transfermarkt::League.fetch_by_league_uri(league_uri)
  after = Time.now

  return {:before => before, :after => after, :league => league}
end

.test_fetch_playerObject



32
33
34
35
# File 'lib/transfermarkt.rb', line 32

def self.test_fetch_player
  uri = "/en/lionel-messi/profil/spieler_28003.html"
  player = Transfermarkt::Player.fetch_by_profile_uri(uri)
end

.test_fetch_player_performance_dataObject



37
38
39
40
# File 'lib/transfermarkt.rb', line 37

def self.test_fetch_player_performance_data
  uri = "/en/lionel-messi/leistungsdaten/spieler_28003_2012.html"
  data = Transfermarkt::Player.fetch_performance_data(uri)
end