-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathProgram.cs
More file actions
78 lines (63 loc) · 2.74 KB
/
Copy pathProgram.cs
File metadata and controls
78 lines (63 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Threading.Tasks;
using Genius;
using Genius.Models.Annotation;
using Genius.Models.Referent;
namespace ExampleApplication
{
class Program
{
public static async Task Main(string[] args)
{
try
{
// Genius.NET doesn't provide OAuth related wrappers.
var client = new GeniusClient("API_KEY");
// GET /annotations/:id
var annotation = await client.AnnotationClient.GetAnnotation(10225840);
// POST /annotations
var newAnnotation = await client.AnnotationClient.PostAnnotation(
new AnnotationPayload("hello **world!**",
new ReferentPayload("http://seejohncode.com/2014/01/27/vim-commands-piping/",
"execute commands",
new ContextForDisplay("You may know that you can",
" from inside of vim, with a vim command:")),
new WebPagePayload(title: "Secret of Mana")));
// PUT /annotations
var updatedAnnotation = await client.AnnotationClient.UpdateAnnotation(
new AnnotationPayload("hello **world!**",
new ReferentPayload("http://seejohncode.com/2014/01/27/vim-commands-piping/",
"execute commands",
new ContextForDisplay("You may know that you can",
" from inside of vim, with a vim command:")),
new WebPagePayload(title: "Secret of Mana")));
// DELETE /annotations/:id
var deletedAnnotation = await client.AnnotationClient.DeleteAnnotation(10225840);
// PUT /annotations/:id/upvote
var upvotedAnnotation = await client.AnnotationClient.UpVoteAnnotation(10225840);
// PUT /annotations/:id/downvote
var downvotedAnnotation = await client.AnnotationClient.DownVoteAnnotation(10225840);
// PUT /annotations/:id/unvote
var unvotedAnnotation = await client.AnnotationClient.UnVoteAnnotation(10225840);
// GET /account
var user = await client.AccountClient.GetAccount();
// GET /referents
var referent = await client.ReferentClient.GetReferent(webPageId: "10347");
// GET /songs/:id
var song = await client.SongClient.GetSong(378195);
// GET /artists/:id
var artist = client.ArtistClient.GetArtist(16775);
// GET /artists/:id/songs
var artistsSongs = await client.ArtistClient.GetArtistsSongs(16775, sort: "title");
// GET /web_pages/lookup
var webPage = await client.WebPageClient.GetWebPage(Uri.EscapeUriString("https://docs.genius.com"));
// GET /search
var search = client.SearchClient.Search("Kendrick Lamar");
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}