public List <string> RecentBangumi() //Back bangumi IDs!! { List <string> bangumiID = new List <string>(); jsonCatcher bangumiJson = new jsonCatcher("http://space.bilibili.com/ajax/Bangumi/getList?mid=" + uid.ToString() + "&page=1"); if ((bool)bangumiJson.json()["status"] == true) { string count = (string)bangumiJson.json()["data"]["count"]; string pages = (string)bangumiJson.json()["data"]["pages"]; if (int.Parse(pages) >= 2) { for (int i = 0; i < 15; i++) { bangumiID.Add((string)bangumiJson.json()["data"]["result"][i]["season_id"]); } } } else { MessageBox.Show("无法从Bilibili拉取番剧数据!"); } return(bangumiID); }
//Get the bangumi pictures from pixiv! private void pixivInit() { pixiv = new getPixiv(bangumiInfo.data()["JapanName"]); //Search this bangumi's japanese name. ArrayList pixivID = pixiv.pic(); //Get the pictures' pixiv ID. PictureBox[] pixivPics; if (pixivID.Count >= 16) //If the count of the pictures is no more than 16. { pixivPics = new PictureBox[16]; } else { pixivPics = new PictureBox[pixivID.Count]; } int row = 0; //2 rows / 16 pictures for (int i = 0; i < pixivPics.Length; i++) { if (i % (pixivPics.Length / 2) == 0 && i != 0) { row++; } //Init the UI int singlePixivID = Convert.ToInt32(pixivID[i]); pixivPics[i] = new PictureBox(); pixivPics[i].Name = "picBox" + Convert.ToString(i + 1); pixivPics[i].Size = new Size(100, 100); pixivPics[i].Location = new Point(70 + i % (pixivPics.Length / 2) * 105, 40 + row * 105); pixivPics[i].SizeMode = PictureBoxSizeMode.StretchImage; pixivPics[i].Tag = singlePixivID; //Send the pixiv ID. pixivPics[i].Click += new System.EventHandler(this.pixivPics_Click); //Click -> open the detail win. //Get the pic detail info jsonCatcher pictureCatcher = new jsonCatcher("https://api.imjad.cn/pixiv/v1/?type=illust&id=" + pixivID[i]); ////Load Pic /// pixivPics[i].ImageLocation = (string)pictureCatcher.json()["response"][0]["image_urls"]["px_128x128"]; this.pagePic.Controls.Add(pixivPics[i]); } int pageNumber = pixivID.Count / 16 + 1; int nowPage = 1; pageNum.Text = nowPage.ToString() + " / " + pageNumber.ToString(); for (int i = 0; i < pixivPics.Length; i++) { Console.WriteLine(pixivID[i]); } }
public pixivDetail(int ID) { InitializeComponent(); pixivID = ID; picDetail = new jsonCatcher("https://api.imjad.cn/pixiv/v1/?type=illust&id=" + pixivID.ToString()); this.picName.Text = (string)picDetail.json()["response"][0]["title"]; this.picAuthor.Text = (string)picDetail.json()["response"][0]["user"]["name"]; getPic(); this.tags = picDetail.json()["response"][0]["tags"]; setTags(); this.picTime.Text = (string)picDetail.json()["response"][0]["reuploaded_time"]; this.picContext.Text = (string)picDetail.json()["response"][0]["caption"]; }
public MusicHunter(string keyword) { //Get music media_mid sWord = keyword + " OP"; //Get the bangumi OP jsonData = new jsonCatcher("http://c.y.qq.com/soso/fcgi-bin/search_cp?p=1&n=3&w=" + keyword + "&aggr=1&lossless=1&cr=1", true); media_mid = (string)jsonData.json()["data"]["song"]["list"][1]["media_mid"]; bSongName = (string)jsonData.json()["data"]["song"]["list"][1]["songname"]; //Get the song name bSongName = bSongName.Replace("(日语", ""); //Delete the useless word. //Get key jsonData = new jsonCatcher("https://c.y.qq.com/base/fcgi-bin/fcg_musicexpress.fcg?json=3&guid=" + key_orginal, true); key = (string)jsonData.json()["key"]; music_url = "http://dl.stream.qqmusic.qq.com/M800" + media_mid + ".mp3?vkey=" + key + "&guid=" + key_orginal + "&fromtag=30"; bSongURL = music_url; //System.Diagnostics.Process.Start(music_url); //Open the music }
private ArrayList backValue = new ArrayList(); //Used to save the pixiv ID. public getPixiv(string name) { //Filter the great pictures. bangumiName = name; //10000 stars getPicJson = new jsonCatcher("https://api.imjad.cn/pixiv/v1/?type=search&word=" + name + " 10000users入り"); addPictureID(); //5000 stars getPicJson = new jsonCatcher("https://api.imjad.cn/pixiv/v1/?type=search&word=" + name + " 5000users入り"); addPictureID(); //1000 stars getPicJson = new jsonCatcher("https://api.imjad.cn/pixiv/v1/?type=search&word=" + name + " 1000users入り"); addPictureID(); //500 stars getPicJson = new jsonCatcher("https://api.imjad.cn/pixiv/v1/?type=search&word=" + name + " 500users入り"); addPictureID(); }