espn_nba_fantasy 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e10a33d89f8e7cb3a06c22e12d45324bfba6b7da1326d43e09b08033622d82ae
|
4
|
+
data.tar.gz: 6b2f19b1bc8dc20355f80058c5ce65a984cc6d3cf667cc1eb015320a7b4a8438
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5c07c8c7a3f1f9b957c7a17ae0114cf7151a47256db4d1b86b8ab050e80587c5313f6ae62e29d2d3e1ceec91564a911280f1fd10140015dcb8760a9d0634a7d
|
7
|
+
data.tar.gz: d682e892cb1d1be1e559f97eece81b9bf4c9cda74b9a19138d5f38cb2a5b6a1660f802843dd09d2682137d0223366906954b11645b53c860c6e10b130c2660f9
|
@@ -10,6 +10,8 @@ class League
|
|
10
10
|
|
11
11
|
attr_accessor :teams, :stat_data
|
12
12
|
|
13
|
+
#initializes the league
|
14
|
+
|
13
15
|
def initialize(league_id, year, s2, sw)
|
14
16
|
@uri = "https://fantasy.espn.com/apis/v3/games/fba/seasons/#{year}/segments/0/leagues/#{league_id}?view=mTeam&view=mRoster&view=mMatchup&view=mSettings&view=mStandings"
|
15
17
|
@cookies = {'espn_s2': "#{s2}", 'SWID': "#{sw}"}
|
@@ -18,10 +20,14 @@ class League
|
|
18
20
|
@stat_data = make_stat_data
|
19
21
|
end
|
20
22
|
|
23
|
+
#gives you an array of each team's name and id in the league
|
24
|
+
|
21
25
|
def team_list
|
22
26
|
@teams.map{|r| [r.name, r.team_id]}
|
23
27
|
end
|
24
28
|
|
29
|
+
#pull up a Player object based on their name and their team
|
30
|
+
|
25
31
|
def findplayer(team_name, str)
|
26
32
|
team = teams.select{|t| t.name == team_name}.first
|
27
33
|
return "No team named #{team_name}" unless team
|
@@ -10,6 +10,8 @@ class Team
|
|
10
10
|
|
11
11
|
attr_accessor :roster, :players, :name, :teamstats, :league, :team_id
|
12
12
|
|
13
|
+
#basic initialization with the various attributes
|
14
|
+
|
13
15
|
def initialize(obj, league)
|
14
16
|
@name = obj['name']
|
15
17
|
@team_id = obj['id']
|
@@ -19,6 +21,12 @@ class Team
|
|
19
21
|
@league = league
|
20
22
|
end
|
21
23
|
|
24
|
+
#method that lets you input who you're trading (Array of names), who you're receiving (Array of names),
|
25
|
+
#and what team you're trading with (String).
|
26
|
+
|
27
|
+
#returns data including the players trading away and receiving, your stats before and after the trade, and your
|
28
|
+
#change in stats for each category
|
29
|
+
|
22
30
|
def trade_players(to_trade = [], to_receive = [], other_team_name)
|
23
31
|
other_team = league.teams.select{|team| team.name == other_team_name}.first
|
24
32
|
return "No team named #{other_team_name}" unless other_team
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: espn_nba_fantasy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Usborn Ocampo
|
@@ -9,7 +9,21 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2023-06-22 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
description: A way to get your league, team, and player information from your ESPN
|
14
28
|
NBA Fantasy League
|
15
29
|
email: usborn116@gmail.com
|
@@ -45,6 +59,5 @@ requirements: []
|
|
45
59
|
rubygems_version: 3.4.14
|
46
60
|
signing_key:
|
47
61
|
specification_version: 4
|
48
|
-
summary:
|
49
|
-
Fantasy League
|
62
|
+
summary: Get info from your ESPN NBA Fantasy League as JSON data
|
50
63
|
test_files: []
|