public void PicTest() { Meting api = new Meting(ServerProvider.Netease); string jsonStr = Api.FormatMethod(true).Pic("002szRig2zZxtj"); Assert.Contains("url", jsonStr); }
public int getMetingType(Meting meting) { switch (type) { case MetingType.HEARTBEAT: return(meting.HeartBeat); case MetingType.RPM: return(meting.RPM); case MetingType.SPEED: return((int)(meting.Speed * 100)); case MetingType.DISTANCE: return((int)(meting.Distance * 100)); case MetingType.POWER: return(meting.Power); case MetingType.ENERGY: return(meting.Energy); case MetingType.SECONDS: return(meting.Seconds); case MetingType.ACTUALPOWER: return(meting.ActualPower); default: return(0); } }
private void updateTimer_Tick(object sender, EventArgs e) { if (MainClient.Doctor.Connected) { MainClient.ComPort.Write("ST"); string response = MainClient.ComPort.Read(); if (response != "err") { Meting m = MainClient.SaveMeting(response); heartBeat.updateValue(m.HeartBeat); RPM.updateValue(m.RPM); power.updateValue(m.Power); actualpower.updateValue(m.ActualPower); time.updateValue(m.Seconds); if (ergotest != null) { ergotest.timerTick(); } } else { logout("De Ergometer is niet meer verbonden.", Color.Red); } } }
public void AddMeting(Meting meting) { Metingen.Add(new Meting() { Id = meting.Id, Created = DateTime.Now, User = this, MetingResultaat = meting.MetingResultaat }); }
public void SearchTest() { Meting api = new Meting(ServerProvider.Netease); string jsonStr = Api.FormatMethod(true).Search("ǧÀïÑûÔÂ"); Assert.Contains("ǧÀïÑûÔÂ", jsonStr); }
private void updateTimer_Tick(object sender, EventArgs e) { if (MainClient.Doctor.Connected) { MainClient.ComPort.Write("ST"); string response = MainClient.ComPort.Read(); if (response != "err") { Meting m = MainClient.SaveMeting(response); heartBeat.updateValue(m.HeartBeat); RPM.updateValue(m.RPM); speed.updateValue(m.Speed); distance.updateValue(m.Distance); power.updateValue(m.Power); energy.updateValue(m.Energy); actualpower.updateValue(m.ActualPower); time.updateValue(m.Seconds); if (count >= 10) { count = 0; panelGraphView.updateAllCharts(MainClient.Metingen); } count++; } else { logout("De Ergometer is niet meer verbonden.", Color.Red); } } }
private void VulKlimatogram() { var metingMadrid = new List <Meting>(); var m = new Meting(1, 5.5, 42); metingMadrid.Add(m); m = new Meting(2, 7.0, 45); metingMadrid.Add(m); m = new Meting(3, 9.3, 30); metingMadrid.Add(m); m = new Meting(4, 11.6, 45); metingMadrid.Add(m); m = new Meting(5, 15.5, 39); metingMadrid.Add(m); m = new Meting(6, 20.4, 26); metingMadrid.Add(m); m = new Meting(7, 24.3, 9); metingMadrid.Add(m); m = new Meting(8, 23.8, 9); metingMadrid.Add(m); m = new Meting(9, 20.3, 28); metingMadrid.Add(m); m = new Meting(10, 14.5, 38); metingMadrid.Add(m); m = new Meting(11, 8.9, 59); metingMadrid.Add(m); m = new Meting(12, 5.9, 44); metingMadrid.Add(m); k = new Klimatogram("Madrid", "Weerstation Madrid", 40.38, -3.56, 1990, 2014); k.setMetingen(metingMadrid); }
public void PicTest() { Meting api = new Meting(ServerProvider.Netease); string jsonStr = Api.FormatMethod(true).Pic("1407374890649284"); Assert.Contains("url", jsonStr); }
public void LyricTest() { Meting api = new Meting(ServerProvider.Netease); string jsonStr = Api.FormatMethod(true).Lyric("35847388"); Assert.Contains("lyric", jsonStr); Assert.Contains("tlyric", jsonStr); }
public void UrlTest() { Meting api = new Meting(ServerProvider.Netease); string jsonStr = Api.FormatMethod(true).Url("35847388"); Assert.Contains("\"url\":", jsonStr); Assert.Contains("\"size\":", jsonStr); Assert.Contains("\"br\":", jsonStr); }
public IActionResult PutMeting(int id, Meting meting) { if (id != meting.Id) { return(BadRequest()); } _metingRepository.Update(meting); _metingRepository.SaveChanges(); return(NoContent()); }
public ActionResult <Meting> GetMeting(int id) { Meting meting = _metingRepository.GetBy(id); if (meting == null) { return(NotFound()); } return(meting); }
/// <summary> /// 搜索歌曲 /// </summary> /// <param name="keyword"></param> /// <param name="options"></param> /// <returns>返回json字符串</returns> //public ActionResult Search(string keyword, Options options = null) //{ // return Json(data, JsonRequestBehavior.AllowGet); ; //} #endregion #region 根据歌曲ID获取 /// <summary> /// 根据歌曲ID获取 /// </summary> /// <param name="id"></param> /// <returns>返回json字符串</returns> public ActionResult Song(string id) { Meting API = new Meting(); var data = API.Url(id); //string.IsNullOrEmpty(data); // EchoJson(data, dic); return(Json(data, JsonRequestBehavior.AllowGet)); }
public IActionResult DeleteMeting(int id) { Meting meting = _metingRepository.GetBy(id); if (meting == null) { return(NotFound()); } _metingRepository.Delete(meting); _metingRepository.SaveChanges(); return(NoContent()); }
public ActionResult Song(string id) { Meting API = new Meting(); Dictionary <string, object> dic = new Dictionary <string, object>(); HttpContext.Request.Params.CopyTo(dic); var data = API.Url(id); //string.IsNullOrEmpty(data); EchoJson(data, dic); return(Json(replacedata(data), JsonRequestBehavior.AllowGet)); }
public void AlbumTest() { Meting api = new Meting(ServerProvider.Netease); string jsonStr = Api.FormatMethod(true).Album("73927024"); Assert.Contains("id", jsonStr); Assert.Contains("name", jsonStr); Assert.Contains("artist", jsonStr); Assert.Contains("album", jsonStr); Assert.Contains("pic_id", jsonStr); Assert.Contains("url_id", jsonStr); Assert.Contains("lyric_id", jsonStr); Assert.Contains("source", jsonStr); }
public void PlaylistTest() { Meting api = new Meting(ServerProvider.Netease); string jsonStr = Api.FormatMethod(true).Playlist("2487120533"); Assert.Contains("id", jsonStr); Assert.Contains("name", jsonStr); Assert.Contains("artist", jsonStr); Assert.Contains("album", jsonStr); Assert.Contains("pic_id", jsonStr); Assert.Contains("url_id", jsonStr); Assert.Contains("lyric_id", jsonStr); Assert.Contains("source", jsonStr); }
public override void Start() { //請勿使用任何阻塞方法 this.Log("弹幕街 Started!"); this.AddDM("弹幕街 Started!", true); if (_window == null) { _window = new MainWindow(this); } Api = new Meting(); Api.Format = true; base.Start(); }
public ActionResult <Meting> PostMeting(MetingDTO meting) { Meting metingToCreate = new Meting() { }; foreach (var i in meting.Resultaten) { metingToCreate.AddResultaat(new Resultaat(i.Vraag, i.Amount)); } metingToCreate.MetingResultaat = meting.MetingResultaat; metingToCreate.User = _userRepository.GetBy(User.Identity.Name); _metingRepository.Add(metingToCreate); _metingRepository.SaveChanges(); return(CreatedAtAction(nameof(GetMeting), new { id = metingToCreate.Id }, metingToCreate)); }
public void SaveMeting(Meting m) { heartBeat.updateValue(m.HeartBeat); RPM.updateValue(m.RPM); speed.updateValue(m.Speed * 100); distance.updateValue(m.Distance * 100); power.updateValue(m.Power); energy.updateValue(m.Energy); actualpower.updateValue(m.ActualPower); time.updateValue(m.Seconds); if (count >= 10) { count = 0; panelGraphView.updateAllCharts(client.Metingen); } count++; }
public static Meting SaveMeting(string meting) { Meting m = null; try { m = Meting.Parse(meting); } catch (Exception e) { return(new Meting(0, 0, 0, 0, 0, 0, 0, 0, 0)); } Metingen.Add(m); if (Doctor.Connected) { NetHelper.SendNetCommand(Doctor, new NetCommand(m, Session)); } return(m); }
static void Main(string[] args) { //Meting api = new Meting("tencent"); //string jsonStr = api.FormatMethod(true).Search("千里邀月"); //Meting api = new Meting("netease"); //string jsonStr = api.FormatMethod(true).Lyric("35847388"); //Meting api = new Meting("tencent"); //string jsonStr = api.FormatMethod(true).Lyric("001Nal2N2f0Qr8"); // 传递通过 .Song("001Nal2N2f0Qr8") 获取的 pic_id 002szRig2zZxtj //string jsonStr = api.Pic("002szRig2zZxtj"); Meting api = new Meting(ServerProvider.Kugou); //string jsonStr = api.FormatMethod(true).Search("千里邀月"); //string jsonStr = api.FormatMethod(true).Lyric("e64025c53de70ba1d91aec1f8c38f1ae"); string jsonStr = api.FormatMethod(true).Pic("e64025c53de70ba1d91aec1f8c38f1ae"); Console.WriteLine(jsonStr); Console.ReadLine(); }
public void Add(Meting meting) { _metingen.Add(meting); }
public void addMeting(Meting meting) { metingen.Add(meting); }
public void Delete(Meting meting) { _metingen.Remove(meting); }
public void Update(Meting meting) { _context.Update(meting); }
public KugouTest() { this.Api = new Meting(ServerProvider.Kugou); }
public MetingController(Meting meting, AppSettings settings) { _meting = meting; _settings = settings; }
public NeteaseTest() { this.Api = new Meting(ServerProvider.Netease); }
static void Main(string[] args) { //Meting api = new Meting("tencent"); //string jsonStr = api.FormatMethod(true).Search("千里邀月"); //Meting api = new Meting("netease"); //string jsonStr = api.FormatMethod(true).Lyric("35847388"); //string jsonStr = api.FormatMethod(true).Song("1332662925"); //Meting api = new Meting("tencent"); //string jsonStr = api.FormatMethod(true).Lyric("001Nal2N2f0Qr8"); // 传递通过 .Song("001Nal2N2f0Qr8") 获取的 pic_id 002szRig2zZxtj //string jsonStr = api.Pic("002szRig2zZxtj"); //Meting api = new Meting(ServerProvider.Kugou); //string jsonStr = api.FormatMethod(true).Search("千里邀月"); //string jsonStr = api.FormatMethod(true).Lyric("e64025c53de70ba1d91aec1f8c38f1ae"); //string jsonStr = api.FormatMethod(true).Pic("e64025c53de70ba1d91aec1f8c38f1ae"); //Meting api = new Meting(ServerProvider.Xiami); //string jsonStr = api.FormatMethod(true).Search("千里邀月"); // 传递通过Search获得的歌曲ID //string jsonStr = api.FormatMethod(true).Song("1808486366"); // https://www.xiami.com/album/2104586331 其中专辑ID为2104586331 //string jsonStr = api.FormatMethod(true).Album("2104586331"); // https://www.xiami.com/artist/593402077?spm=a1z1s.3057853.6862625.41.phWDbn 作家ID 593402077 //string jsonStr = api.FormatMethod(true).Artist("593402077"); // https://www.xiami.com/collect/632580584 歌单ID 632580584 //string jsonStr = api.FormatMethod(true).Playlist("632580584"); //string jsonStr = api.FormatMethod(true).Url("1808486366"); // https://www.xiami.com/song/1774129963 歌曲ID 1774129963 // 有翻译歌词 //string jsonStr = api.FormatMethod(true).Lyric("1774129963"); // 无翻译歌词 //string jsonStr = api.FormatMethod(true).Lyric("1768955559"); // 无歌词 //string jsonStr = api.FormatMethod(true).Lyric("1772326454"); //string jsonStr = api.Pic("1772326454"); //string jsonStr = api.ProxyMethod(new MetingProxy("47.97.169.111", 3128)).FormatMethod(true).Lyric("1774129963"); //Console.WriteLine(jsonStr); //Music_search_item[] music_Search_Items = api.SearchObj("千里邀月"); //Music_search_item music_Search_Item = api.SongObj("1808486366"); //Music_search_item[] music_Search_Items = api.AlbumObj("2104586331"); //Music_search_item[] music_Search_Items = api.ArtistObj("593402077"); //Music_search_item[] music_Search_Items = api.PlaylistObj("632580584"); //Music_url music_Url = api.UrlObj("1808486366"); //Music_lyric music_Lyric = api.LyricObj("1774129963"); //Music_pic music_Pic = api.PicObj("1772326454"); Meting api = new Meting(ServerProvider.Baidu); //Music_search_item[] items = api.SearchObj("洛少爷"); //Music_search_item song = api.SongObj("73992640"); // http://music.taihe.com/album/533414191 专辑ID 533414191 //Music_search_item[] musics = api.AlbumObj("533414191"); // http://music.taihe.com/artist/1052 作家ID 1052 //Music_search_item[] musics = api.ArtistObj("1052"); // http://music.taihe.com/songlist/566104573 歌单ID 566104573 //Music_search_item[] musics = api.PlaylistObj("566104573"); // 目前百度音乐获取到的音乐链接当复制到浏览器地址栏时只可用于下载,不可在线播放 //Music_url url = api.UrlObj("73992640"); // http://music.taihe.com/song/976984 歌曲ID 976984 //Music_lyric lyric = api.LyricObj("976984"); Music_pic pic = api.PicObj("976984"); Console.ReadLine(); }
// GET: Home public ContentResult Index() { #region 网易云音乐 API //Meting api = new Meting("netease"); //string jsonStr = api.FormatMethod(true).Url("35847388"); //string jsonStr = api.FormatMethod(true).Song("35847388"); //string jsonStr = api.FormatMethod(true).Album("73927024"); //string jsonStr = api.Album("73927024"); //string jsonStr = api.FormatMethod(true).Artist("1049179"); //string jsonStr = api.FormatMethod(true).Playlist("2487120533"); //string jsonStr = api.FormatMethod(true).Lyric("35847388"); //string jsonStr = api.FormatMethod(false).Lyric("35847388"); // 错误:传递歌曲ID //string jsonStr = api.Pic("527190053"); // 错误:传递专辑ID //string jsonStr = api.Pic("73927024"); // 正确:传递通过 api.Song("35847388") 获取到的 pic_id //string jsonStr = api.Pic("1407374890649284"); // 需要设置 page 时,必须同时设置 limit 才有效 //string jsonStr = api.FormatMethod(true).Search("Soldier", new Meting4Net.Core.Models.Standard.Options //{ // page = 1, // limit = 50 //}); //string jsonStr = api.FormatMethod(true).Search("Soldier"); // 只返回 3 条 原始网易音乐格式 //string jsonStr = api.FormatMethod(false).Search("Soldier", new Meting4Net.Core.Models.Standard.Options //{ // limit = 3 //}); #endregion #region 腾讯QQ音乐 API //Meting api = new Meting("tencent"); //string jsonStr = api.FormatMethod(true).Search("千里邀月"); // 腾讯传递 通过Search() 获取到的 歌曲 "id" //string jsonStr = api.FormatMethod(true).Song("001Nal2N2f0Qr8"); // 例如专辑 https://y.qq.com/n/yqq/album/001AMQBG3GzakR.html#stat=y_new.album.otheralbum.click // 则其中 001AMQBG3GzakR 为专辑ID //string jsonStr = api.FormatMethod(true).Album("001AMQBG3GzakR"); // https://y.qq.com/n/yqq/singer/001fNHEf1SFEFN.html#stat=y_new.singerlist.singerpic // 其中 001fNHEf1SFEFN 为 歌手ID //string jsonStr = api.FormatMethod(true).Artist("001fNHEf1SFEFN"); // https://y.qq.com/n/yqq/playsquare/1721973967.html#stat=y_new.playlist.pic_click // 其中 1721973967 为歌单ID //string jsonStr = api.FormatMethod(true).Playlist("1721973967"); // https://y.qq.com/n/yqq/song/001Nal2N2f0Qr8.html //string jsonStr = api.FormatMethod(true).Url("001Nal2N2f0Qr8"); // //string jsonStr = api.FormatMethod(true).Lyric("001Nal2N2f0Qr8"); #endregion #region 酷狗音乐 API Meting api = new Meting(ServerProvider.Kugou); //string jsonStr = api.FormatMethod(true).Search("千里邀月"); // 传递通过 Search("千里邀月") 获得的 歌曲id //string jsonStr = api.FormatMethod(true).Song("e64025c53de70ba1d91aec1f8c38f1ae"); // http://www.kugou.com/share/9vXiM9bt7V2.html#hash=8B264F3E5F587DDB2631660B34CD43FB&album_id=1746593 // 其中 album_id= 后的 1746593 即为专辑ID //string jsonStr = api.FormatMethod(true).Album("1746593"); // https://www.kugou.com/singer/19671.html 其中 19671 即为作家ID //string jsonStr = api.FormatMethod(true).Artist("19671"); // https://www.kugou.com/yy/special/single/602964.html 其中 602964 即为歌单ID //string jsonStr = api.FormatMethod(true).Playlist("602964"); // 传递 歌曲ID string jsonStr = api.FormatMethod(true).Url("e64025c53de70ba1d91aec1f8c38f1ae"); #endregion return(Content(jsonStr, "application/json")); }