open dota: คุณกำลังดูกระทู้
Unofficial Ruby Gem for OpenDotaAPI. This API provides Dota 2 related data.
Please keep request rate to approximately 3/s.
NỘI DUNG BÀI VIẾT
Installation
If you use Rubygems you can type:
gem
install
open_dota_api
or add this line to your application’s Gemfile:
gem
'open_dota_api'
then execute:
$ bundle
Using
To use OpenDotaApi you can:
require
'open_dota_api'
Use available methods to gather needed data:
# Leagues listing
OpenDotaApi
.
leagues
# Teams listing
OpenDotaApi
.
teams
# Match details
OpenDotaApi
.
matches
(
match_id
)
# Heroes listing
OpenDotaApi
.
heroes
# Pro players listing
OpenDotaApi
.
pro_players
# Explorer output (limited)
OpenDotaApi
.
explorer
(
league_id
)
# Player (account) details
OpenDotaApi
.
players
(
account_id
)
Beginning 2018-04-22, the OpenDota API is limited to 50,000 free calls per month and 60 requests/minute.
We offer a Premium Tier with unlimited API calls and higher rate limits.
Check out the API page to learn more.
Please follow the link to Get the KEY.
Requests Limit:
To check the request limit for Free Tier:
OpenDotaApi
.
limits
Output:
{
per_min: "0", # request left for per minute
per_month: "49878" # request left for per month
}
Using the API_KEY
After you get you personal key you have two options:
-
Set
api_key
globally to all your request.
For Rails application you can create the initializer:# config/initializers/open_dota_api.rb
OpenDotaApi
.
api_key
=
[
YOUR_KEY_HERE
]
-
Or you can set
api_key
directly in the request:OpenDotaApi
.
leagues
(
api_key:
[
YOUR_KEY_HERE
])
OpenDotaApi
.
teams
(
api_key:
[
YOUR_KEY_HERE
])
OpenDotaApi
.
matches
(
match_id
,
api_key:
[
YOUR_KEY_HERE
])
OpenDotaApi
.
heroes
(
api_key:
[
YOUR_KEY_HERE
])
OpenDotaApi
.
pro_players
(
api_key:
[
YOUR_KEY_HERE
])
OpenDotaApi
.
explorer
(
league_id
,
api_key:
[
YOUR_KEY_HERE
])
OpenDotaApi
.
players
(
account_id
,
api_key:
[
YOUR_KEY_HERE
])
Enjoy!
Endpoints
Leagues
API Method: leagues
leagues
=
OpenDotaApi
.
leagues
leagues
# array
league
=
leagues
.
first
league
.
class
# OpenDotaApi::Leagues
league
.
league_id
# Number, league ID
league
.
ticket
# String, ticket identifier
league
.
banner
# String, banner identifier
league
.
tier
# String, premiere, pro, amateur
league
.
name
# String, league name
Teams
API Method: teams
teams
=
OpenDotaApi
.
teams
teams
# array
team
=
teams
.
first
team
.
class
# OpenDotaApi::Team
team
.
team_id
team
.
rating
team
.
wins
team
.
losses
team
.
last_match_time
team
.
name
team
.
tag
Players
API Method: players
account_id
=
65366604
# number, is required
player
=
OpenDotaApi
.
players
(
account_id
)
player
.
class
# OpenDotaApi::Player
player
.
account_id
player
.
mmr_estimate
player
.
plus
player
.
contributor?
player
.
steam_id
player
.
avatar
player
.
avatar_medium
player
.
avatar_full
player
.
profile_url
player
.
persona_name
player
.
last_login
player
.
cheese
player
.
loc_country_code
player
.
name
player
.
tracked_until
player
.
rank_tier
player
.
competitive_rank
player
.
solo_competitive_rank
player
.
leaderboard_rank
Matches
API Method: matches
match_id
=
0000000001
# number, is required
match
=
OpenDotaApi
.
matches
(
match_id
)
match
.
class
# OpenDotaApi::Match
match
.
match_id
match
.
start_time
match
.
duration
match
.
series_id
match
.
series_type
match
.
radiant_team_id
match
.
dire_team_id
match
.
match_seq_num
match
.
league_id
match
.
first_blood_time
match
.
winner
match
.
cluster
match
.
replay_salt
match
.
cluster
match
.
replay_url
match
.
radiant_score
# Integer
match
.
dire_score
# Integer
match
.
players
# array of players (type OpenDotaApi::Matches::Player)
Player
players
=
match
.
players
player
=
players
.
first
player
.
class
# OpenDotaApi::Matches::Player
player
.
match_id
# related to OpenDotaApi::Match
player
.
player_slot
player
.
account_id
player
.
assists
player
.
camps_stacked
player
.
deaths
player
.
denies
player
.
gold_per_min
player
.
hero_id
# related to OpenDotaApi::Hero
player
.
kills
player
.
obs_placed
player
.
sen_placed
player
.
rune_pickups
player
.
stuns
player
.
xp_per_min
player
.
name
player
.
side
player
.
kda
player
.
tower_kills
player
.
roshan_kills
player
.
hero_healing
player
.
last_hits
player
.
firstblood_claimed
player
.
hero_damage
player
.
teamfight_participation
Heroes
API Method: heroes
heroes
=
OpenDotaApi
.
heroes
heroes
.
class
# array
hero
=
heroes
.
first
hero
.
class
# OpenDotaApi::Hero
hero
.
id
hero
.
name
hero
.
localized_name
# "Anti-mage"
hero
.
primary_attr
hero
.
attack_type
hero
.
roles
# array of roles
hero
.
legs
Pro Players
API Method: proPlayers
pro_players
=
OpenDotaApi
.
pro_players
pro_players
.
class
# array
pro_player
=
pro_players
.
first
pro_player
.
class
# OpenDotaApi::ProPlayer
pro_player
.
account_id
pro_player
.
steam_id
pro_player
.
avatar
pro_player
.
avatar_medium
pro_player
.
avatar_full
pro_player
.
profile_url
pro_player
.
persona_name
pro_player
.
last_login
pro_player
.
full_history_time
pro_player
.
cheese
pro_player
.
fh_unavailable
pro_player
.
loc_country_code
pro_player
.
last_match_time
pro_player
.
name
pro_player
.
country_code
pro_player
.
fantasy_role
pro_player
.
team_id
pro_player
.
team_name
pro_player
.
team_tag
pro_player
.
locked?
pro_player
.
pro?
pro_player
.
locked_until
Explorer
API Method: explorer
explorer
=
OpenDotaApi
.
explorer
(
league_id
)
explorer
.
class
# OpenDotaApi::Explorer
explorer
.
league_matches_ids
# Array of matches IDs for current league
…
That’s all for now.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/vergilet/open_dota_api
Feel free to contribute:
- Fork it (https://github.com/vergilet/open_dota_api/fork)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am ‘Add some feature’)
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
License
The gem is available as open source under the terms of the MIT License.
Copyright © 2017 Yaro.
[NEW] OpenDota API | open dota – Vietnamnhanvan
做了一个小工具
主要是利用 opendota 的 api 检测我打 dota 时的坑爹队友的
//analyzedota.pro
QT
-=
gui
QT
+=
network
CONFIG
+=
c
++
11
console
CONFIG
-=
app_bundle
DEFINES
+=
QT_DEPRECATED_WARNINGS
SOURCES
+=
\
main
.
cpp
\
analyzedota
.
cpp
HEADERS
+=
\
analyzedota
.
h
//analyzedota.h
#ifndef ANALYZEDOTA_H
#define ANALYZEDOTA_H
#include
<QNetworkAccessManager>
#include
<QNetworkProxy>
#include
<QNetworkReply>
#include
<QUrl>
#include
<QSslConfiguration>
#include
<QJsonDocument>
#include
<QJsonArray>
#include
<QJsonObject>
#include
<QHash>
#include
<QPair>
#include
<QHashIterator>
class
AnalyzeDota
:
QObject
{
Q_OBJECT
public
:
explicit
AnalyzeDota
(
QObject
*
parent
=
);
QList
<
QString
>
all_match_id
;
QHash
<
int
,
int
>
enemyHeros
;
//name, number
QHash
<
int
,
int
>
friendHeros
;
int
index
;
bool
error
;
void
mainHandle
();
public
slots
:
void
oneMatch
(
QString
match_id
);
private
:
QNetworkAccessManager
*
manager
;
QSslConfiguration
config
;
};
#endif
//
analyzedota.cpp
#include
"analyzedota.h"
#include
<QTimer>
AnalyzeDota
::
AnalyzeDota
(
QObject
*
parent
)
:
QObject
(
parent
)
{
QNetworkProxy
proxy
;
proxy
.
setType
(
QNetworkProxy
::
HttpProxy
);
proxy
.
setHostName
(
"代理服务器"
);
proxy
.
setPort
(
8080
);
proxy
.
setUser
(
"账号"
);
proxy
.
setPassword
(
"密码"
);
QNetworkProxy
::
setApplicationProxy
(
proxy
);
manager
=
new
QNetworkAccessManager
(
this
);
manager
->
setProxy
(
proxy
);
config
.
setPeerVerifyMode
(
QSslSocket
::
VerifyNone
);
config
.
setProtocol
(
QSsl
::
TlsV1_0
);
}
void
AnalyzeDota
::
mainHandle
()
{
QNetworkRequest
request
(
QUrl
(
QString
(
"https://api.opendota.com/api/players/刀塔数字ID/matches/?hero_id=59&win=1&api_key=申请的SDK秘钥"
)));
request
.
setSslConfiguration
(
config
);
QNetworkReply
*
reply
=
manager
->
get
(
QNetworkRequest
(
request
));
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
=
](){
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
qDebug
()
<<
"get data error!"
<<
int
(
reply
->
error
());
}
else
{
QByteArray
ba
=
reply
->
readAll
();
QJsonDocument
jsonDoucment
=
QJsonDocument
::
fromJson
(
ba
);
QJsonArray
array
=
jsonDoucment
.
array
();
for
(
int
i
=
;
i
<
array
.
size
();
i
++
)
{
QJsonObject
object
=
array
.
at
(
i
).
toObject
();
QString
match_id
=
object
[
"match_id"
].
toVariant
().
toString
();
all_match_id
<<
match_id
;
}
index
=
;
error
=
true
;
qDebug
()
<<
all_match_id
.
at
(
index
);
oneMatch
(
all_match_id
.
at
(
index
));
}
reply
->
deleteLater
();
});
}
void
AnalyzeDota
::
oneMatch
(
QString
match_id
)
{
qDebug
()
<<
match_id
;
QNetworkRequest
request
(
QUrl
(
QString
(
"https://api.opendota.com/api/matches/%1/?api_key=申请的SDK秘钥"
).
arg
(
match_id
)));
request
.
setSslConfiguration
(
config
);
QNetworkReply
*
reply
=
manager
->
get
(
QNetworkRequest
(
request
));
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
=
](){
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
qDebug
()
<<
"get data error!"
<<
int
(
reply
->
error
());
if
(
error
)
{
qDebug
()
<<
"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr"
;
error
=
false
;
}
QTimer
::
singleShot
(
10000
,[
=
](){
oneMatch
(
all_match_id
.
at
(
index
));
});
}
else
{
error
=
true
;
QByteArray
ba
=
reply
->
readAll
();
QJsonDocument
jsonDoucment
=
QJsonDocument
::
fromJson
(
ba
);
QJsonObject
object
=
jsonDoucment
.
object
();
QJsonArray
array
=
object
[
"players"
].
toArray
();
QHash
<
int
,
bool
>
hash
;
for
(
int
i
=
;
i
<
array
.
size
();
i
++
)
{
QJsonObject
object
=
array
.
at
(
i
).
toObject
();
qlonglong
hero_id
=
object
[
"hero_id"
].
toInt
();
bool
isRadiant
=
object
[
"isRadiant"
].
toBool
();
hash
.
insert
(
hero_id
,
isRadiant
);
}
bool
team
=
hash
.
value
(
59
);
QHashIterator
<
int
,
bool
>
i
(
hash
);
while
(
i
.
hasNext
())
{
i
.
next
();
if
(
i
.
key
()
!=
59
)
{
if
(
i
.
value
()
==
team
)
{
int
newValue
=
friendHeros
.
value
(
i
.
key
(),
)
+
1
;
friendHeros
.
insert
(
i
.
key
(),
newValue
);
}
else
{
int
newValue
=
enemyHeros
.
value
(
i
.
key
(),
)
+
1
;
enemyHeros
.
insert
(
i
.
key
(),
newValue
);
}
}
}
index
++
;
if
(
all_match_id
.
size
()
!=
index
)
{
oneMatch
(
all_match_id
.
at
(
index
));
}
else
{
QHashIterator
<
int
,
int
>
i
(
friendHeros
);
while
(
i
.
hasNext
())
{
i
.
next
();
qDebug
()
<<
i
.
key
()
<<
i
.
value
();
}
qDebug
()
<<
"tttttttttttttttttt"
;
QHashIterator
<
int
,
int
>
j
(
enemyHeros
);
while
(
j
.
hasNext
())
{
j
.
next
();
qDebug
()
<<
j
.
key
()
<<
j
.
value
();
}
}
}
reply
->
deleteLater
();
});
}
//main.cpp
#include
<QCoreApplication>
#include
"analyzedota.h"
int
main
(
int
argc
,
char
*
argv
[])
{
QCoreApplication
a
(
argc
,
argv
);
AnalyzeDota
analyzeDota
(
nullptr
);
analyzeDota
.
mainHandle
();
return
a
.
exec
();
}
59 代表的是 神灵武士 哈斯卡
win = 0 或 1 代表 我打那么多把神灵的输赢
后续改进一下,编译成 Android app 吧,给自己用
其实主要是觉得 Max+ app 不好用
Đỗ Phú Quí | HELLO GOODBYE (안녕) – Hyorin | Vietnamese Cover | Official Audio
OST Who You Came From The Stars
Official Audio : https://beta.mp3.zing.vn/baihat/HelloGoodbyeDoPhuQui/ZW6BOBO7.html
Đỗ Phú Quí’s Official Facebook : https://www.facebook.com/dophuqui
Đỗ Phú Quí’s Official Fanpage : https://www.facebook.com/dophuquioffi…
Đỗ Phú Quí’s Official Instagram : http://www.instagram.com/dophuqui
Đỗ Phú Quí’s Official Tiktok : dophuqui
Don’t forget to Subscribe this Channel in order to update all Đỗ Phú Quí’s activities.
Many Thanks.
dophuqui hellogoodbye cover
นอกจากการดูบทความนี้แล้ว คุณยังสามารถดูข้อมูลที่เป็นประโยชน์อื่นๆ อีกมากมายที่เราให้ไว้ที่นี่: ดูความรู้เพิ่มเติมที่นี่
Estadisticas Dota 2 – Open Dota
Link de la página :https://www.opendota.com/
R E D E S S O C I A L E S
✘ P A T R E O N :https://www.patreon.com/Frishx
✘ D O N A C I O N E S P A Y P A L : https://goo.gl/3JBpVp
✘ F A C E B O O K : https://www.facebook.com/frishx/
✘ T W I T T E R : https://twitter.com/frishx
✘ I N S T A G R A M: https://www.instagram.com/frishx/
✘ T W I T C H : https://www.twitch.tv/frishx
\”If you Doom Luna We win the Game\”
\”If you Doom Luna We win the Game\”
Credits : https://www.twitch.tv/icebergdoto
My Second Channel :https://www.youtube.com/channel/UCevqzvxnHjEAPlmWqi5Ag
Welcome to my channel AGamers Dota 2
Dota 2 Wtf Moments Pro Game Play Bugs
Here the find highlights from random pub match, random pro match, major tournaments and many other interesting dota movies.
Remember to SUBSCRIBE to be notified when we publish new videos or highlights!
Music Links:……
1: https://www.youtube.com/watch?v=K3tcmizK_CA
2: https://www.youtube.com/watch?v=ms0pqYozThU
3:https://www.youtube.com/watch?v=u5ljKDJv0fA
4:https://drive.google.com/open?id=1HX27VFtb0ydjZV4AUKeOVJMM_AtSo
dota 2
dota 2 wtf
dota 2 live
dota 2 gameplay
dota 2 highlights
dota 2 new hero
dota 2 wtf moments
dota 2 tournament
Dota 2 #TI8 – Opening Ceremony
You can watch TI8 here: https://www.twitch.tv/dota2ti
Dota 2 #TI9 Opening Ceremony
Watch live: https://www.twitch.tv/dota2ti
นอกจากการดูบทความนี้แล้ว คุณยังสามารถดูข้อมูลที่เป็นประโยชน์อื่นๆ อีกมากมายที่เราให้ไว้ที่นี่: ดูวิธีอื่นๆWiki
ขอบคุณมากสำหรับการดูหัวข้อโพสต์ open dota