├── JodelAPI
├── JodelAPI
│ ├── packages.config
│ ├── Json
│ │ ├── Request
│ │ │ ├── JsonRequestRefreshAccessToken.cs
│ │ │ ├── JsonRequestUpDownVote.cs
│ │ │ ├── JsonRequest.cs
│ │ │ ├── JsonRequestRecommendedChannels.cs
│ │ │ ├── JsonRequestFollowedChannelMeta.cs
│ │ │ ├── JsonRequestPostsLocationCombo.cs
│ │ │ ├── JsonRequestGenerateAccessToken.cs
│ │ │ ├── JsonRequestSetLocation.cs
│ │ │ └── JsonRequestPostJodel.cs
│ │ └── Response
│ │ │ ├── JsonKarma.cs
│ │ │ ├── JsonRefreshTokens.cs
│ │ │ ├── JsonCaptcha.cs
│ │ │ ├── JsonPostJodel.cs
│ │ │ ├── JsonRecommendedChannels.cs
│ │ │ ├── JsonTokens.cs
│ │ │ ├── JsonFollowedChannelsMeta.cs
│ │ │ ├── JsonModeration.cs
│ │ │ ├── JsonPostDetail.cs
│ │ │ ├── JsonConfig.cs
│ │ │ ├── JsonJodelsFirstRound.cs
│ │ │ ├── JsonMyPins.cs
│ │ │ ├── JsonMyJodels.cs
│ │ │ ├── JsonJodelsLastRound.cs
│ │ │ ├── JsonGCoordinates.cs
│ │ │ ├── JsonMyVotes.cs
│ │ │ ├── JsonMyComments.cs
│ │ │ ├── JsonPostJodels.cs
│ │ │ ├── JsonComments.cs
│ │ │ └── JsonGetJodelsFromChannel.cs
│ ├── Exceptions
│ │ └── LocationNotFoundException.cs
│ ├── Internal
│ │ ├── Helpers.cs
│ │ ├── Constants.cs
│ │ ├── JodelWebClient.cs
│ │ ├── Links.cs
│ │ └── ApiCall.cs
│ ├── Shared
│ │ ├── JodelMainData.cs
│ │ ├── Channel.cs
│ │ ├── Location.cs
│ │ ├── AccessToken.cs
│ │ ├── User.cs
│ │ ├── Captcha.cs
│ │ └── JodelPost.cs
│ ├── JodelAPI.nuspec
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── JodelApp.cs
│ ├── JodelAPI.csproj
│ ├── Jodel.cs
│ └── Account.cs
├── JodelAPITests
│ ├── JodelTests.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── JodelAPITests.csproj
└── JodelAPI.sln
├── .gitattributes
├── README.md
└── .gitignore
/JodelAPI/JodelAPI/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequestRefreshAccessToken.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Request
8 | {
9 | class JsonRequestRefreshAccessToken : JsonRequest
10 | {
11 | public string refresh_token { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonKarma.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Response
8 | {
9 | internal class JsonKarma
10 | {
11 | public class RootObject
12 | {
13 | public int karma { get; set; }
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequestUpDownVote.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Request
8 | {
9 | internal class JsonRequestUpDownVote:JsonRequest
10 | {
11 | #region
12 |
13 | public int reason_code { get; set; } = -1;
14 |
15 | #endregion
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonRefreshTokens.cs:
--------------------------------------------------------------------------------
1 | namespace JodelAPI.Json.Response
2 | {
3 | internal class JsonRefreshTokens
4 | {
5 | public class RootObject
6 | {
7 | public string access_token { get; set; }
8 | public string token_type { get; set; }
9 | public int expires_in { get; set; }
10 | public int expiration_date { get; set; }
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Newtonsoft.Json;
7 |
8 | namespace JodelAPI.Json.Request
9 | {
10 | public abstract class JsonRequest
11 | {
12 | public override string ToString()
13 | {
14 | return JsonConvert.SerializeObject(this);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonCaptcha.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Response
8 | {
9 | internal class JsonCaptcha
10 | {
11 | public class RootObject
12 | {
13 | public string key { get; set; }
14 | public string image_url { get; set; }
15 | public int image_size { get; set; }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequestRecommendedChannels.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Request
8 | {
9 | internal class JsonRequestRecommendedChannels : JsonRequest
10 | {
11 | #region Methods
12 |
13 | public override string ToString()
14 | {
15 | return "home: false";
16 | }
17 |
18 | #endregion
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonPostJodel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Response
8 | {
9 | internal class JsonPostJodel
10 | {
11 | public class RootObject
12 | {
13 | #region Fields and Properties
14 |
15 | public long created_at { get; set; }
16 | public string post_id { get; set; }
17 |
18 | #endregion
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonRecommendedChannels.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace JodelAPI.Json.Response
4 | {
5 | internal class JsonRecommendedChannels
6 | {
7 | public class Recommended
8 | {
9 | public string channel { get; set; }
10 | public int followers { get; set; }
11 | public string image_url { get; set; }
12 | }
13 |
14 | public class RootObject
15 | {
16 | public List recommended { get; set; }
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonTokens.cs:
--------------------------------------------------------------------------------
1 | namespace JodelAPI.Json.Response
2 | {
3 | internal class JsonTokens
4 | {
5 | public class RootObject
6 | {
7 | public string access_token { get; set; }
8 | public string refresh_token { get; set; }
9 | public string token_type { get; set; }
10 | public int expires_in { get; set; }
11 | public int expiration_date { get; set; }
12 | public string distinct_id { get; set; }
13 | public bool returning { get; set; }
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Exceptions/LocationNotFoundException.cs:
--------------------------------------------------------------------------------
1 | [System.Serializable()]
2 | class LocationNotFoundException : System.Exception
3 | {
4 | public LocationNotFoundException() { }
5 | public LocationNotFoundException(string message) : base(message) { }
6 | public LocationNotFoundException(string message, System.Exception inner) : base(message, inner) { }
7 |
8 | // A constructor is needed for serialization when an
9 | // exception propagates from a remoting server to the client.
10 | protected LocationNotFoundException(System.Runtime.Serialization.SerializationInfo info,
11 | System.Runtime.Serialization.StreamingContext context)
12 | { }
13 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonFollowedChannelsMeta.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Response
8 | {
9 | internal class JsonFollowedChannelsMeta
10 | {
11 | public class Channel
12 | {
13 | public string channel { get; set; }
14 | public int followers { get; set; }
15 | public bool sponsored { get; set; }
16 | public bool unread { get; set; }
17 | }
18 |
19 | public class RootObject
20 | {
21 | public List channels { get; set; }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Internal/Helpers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Security.Cryptography;
4 | using static JodelAPI.Shared.JodelPost;
5 |
6 | namespace JodelAPI.Internal
7 | {
8 | internal static class Helpers
9 | {
10 | static Dictionary Colors = new Dictionary
11 | {
12 | { PostColor.Red, "DD5F5F" },
13 | { PostColor.Orange, "FF9908" },
14 | { PostColor.Yellow, "FFBA00" },
15 | { PostColor.Blue, "DD5F5F" },
16 | { PostColor.Bluegreyish, "8ABDB0" },
17 | { PostColor.Green, "9EC41C" },
18 | { PostColor.Random, "FFFFFF" }
19 | };
20 |
21 | public static string GetColor(PostColor color) => Colors[color];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonModeration.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace JodelAPI.Json.Response
4 | {
5 | internal class JsonModeration
6 | {
7 | public class Queue
8 | {
9 | public string post_id { get; set; }
10 | public string message { get; set; }
11 | public int vote_count { get; set; }
12 | public string color { get; set; }
13 | public string user_handle { get; set; }
14 | public int task_id { get; set; }
15 | public int flag_count { get; set; }
16 | public string parent_id { get; set; }
17 | public int flag_reason { get; set; }
18 | }
19 |
20 | public class RootObject
21 | {
22 | public List posts { get; set; }
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Shared/JodelMainData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Shared
8 | {
9 | public class JodelMainData
10 | {
11 | #region Fields and Properties
12 |
13 | public int Max { get; set; }
14 |
15 | public List RecentJodels { get; set; }
16 | public List RepliedJodels { get; set; }
17 | public List VotedJodels { get; set; }
18 |
19 | #endregion
20 |
21 | #region Constructor
22 |
23 | public JodelMainData()
24 | {
25 | RecentJodels = new List();
26 | RepliedJodels = new List();
27 | VotedJodels = new List();
28 | }
29 |
30 | #endregion
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/JodelAPI.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | JodelAPI
5 | 4.47.0.0
6 | Luca Marcelli
7 | Luca Marcelli
8 | https://github.com/ioncodes/JodelAPI
9 | false
10 | A .NET wrapper for the Jodel API.
11 | A .NET wrapper for the Jodel API.
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequestFollowedChannelMeta.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Newtonsoft.Json;
7 |
8 | namespace JodelAPI.Json.Request
9 | {
10 | internal class JsonRequestFollowedChannelMeta : JsonRequest
11 | {
12 | #region Fields and Properties
13 |
14 | public Dictionary Values { get; set; }
15 |
16 | #endregion
17 |
18 | #region Constructor
19 |
20 | public JsonRequestFollowedChannelMeta()
21 | {
22 | Values = new Dictionary();
23 | }
24 |
25 | #endregion
26 |
27 | #region Methods
28 |
29 | public override string ToString()
30 | {
31 | return JsonConvert.SerializeObject(Values);
32 | }
33 |
34 | #endregion
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequestPostsLocationCombo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Request
8 | {
9 | internal class JsonRequestPostsLocationCombo : JsonRequest
10 | {
11 | #region Fields and Properties
12 |
13 | public string Lat { get; set; }
14 | public string Lng { get; set; }
15 | public bool Stickies { get; set; }
16 | public bool Home { get; set; }
17 |
18 | #endregion
19 |
20 | #region Methods
21 |
22 | public override string ToString()
23 | {
24 | return @"lat: " + Lat + "@\n" +
25 | @"lng: " + Lng + "@\n" +
26 | @"stickers: " + Stickies + @"\n" +
27 | @"home: " + Home;
28 | }
29 |
30 | #endregion
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequestGenerateAccessToken.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Request
8 | {
9 | public class JsonRequestGenerateAccessToken : JsonRequest
10 | {
11 | public string device_uid { get; set; }
12 | public Location location { get; set; }
13 | public string client_id { get; set; }
14 |
15 | public class Location
16 | {
17 | public string City { get; set; }
18 | public double loc_accuracy { get; set; }
19 | public Coordinates loc_coordinates { get; set; }
20 | public string country { get; set; }
21 |
22 | public class Coordinates
23 | {
24 | public double lat { get; set; }
25 | public double lng { get; set; }
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonPostDetail.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace JodelAPI.Json.Response
4 | {
5 | internal class JsonPostDetail
6 | {
7 | public class LocCoordinates : JsonPostJodels.LocCoordinates { }
8 |
9 | public class Location : JsonPostJodels.Location { }
10 |
11 | public class ImageHeaders : JsonPostJodels.ImageHeaders { }
12 |
13 | public class Post : JsonPostJodels.Post
14 | {
15 | public string ancestor;
16 | public bool from_home;
17 | public int parent_creator;
18 | public string parent_id;
19 | public bool pinned;
20 | public string replier_mark;
21 | }
22 |
23 | public class RootObject
24 | {
25 | public Post details { get; set; }
26 | public string next { get; set; }
27 | public int remaining { get; set; }
28 | public List replies { get; set; }
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Internal/Constants.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace JodelAPI.Internal
9 | {
10 | internal class Constants
11 | {
12 | // Key Values
13 | public const string Key = "";
14 | public const string ClientId = "81e8a76e-1e02-4d17-9ba0-8a7020261b26";
15 | public const string AppVersion = "4.47.0";
16 |
17 |
18 | // Headers
19 | public static WebHeaderCollection Header = new WebHeaderCollection
20 | {
21 | {"Accept-Encoding", "gzip"},
22 | {"User-Agent", "Jodel/" + AppVersion + " Dalvik/2.1.0 (Linux; U; Android 6.0.1; E6653 Build/32.2.A.0.305)"},
23 | {"X-Client-Type", "android_" + AppVersion},
24 | {"X-Api-Version", "0.2"}
25 | };
26 | public static WebHeaderCollection JsonHeader = new WebHeaderCollection
27 | {
28 | {"Content-Type", "application/json; charset=UTF-8"}
29 | };
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace JodelAPI.Json
4 | {
5 | internal class JsonConfig
6 | {
7 | public class Experiment
8 | {
9 | public string name { get; set; }
10 | public string group { get; set; }
11 | public List features { get; set; }
12 | }
13 |
14 | public class RootObject
15 | {
16 | public bool moderator { get; set; }
17 | public object user_type { get; set; }
18 | public List experiments { get; set; }
19 | public List followed_channels { get; set; }
20 | public List followed_hashtags { get; set; }
21 | public int channels_follow_limit { get; set; }
22 | public bool triple_feed_enabled { get; set; }
23 | public string home_name { get; set; }
24 | public bool home_set { get; set; }
25 | public string location { get; set; }
26 | public bool verified { get; set; }
27 |
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequestSetLocation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Request
8 | {
9 | internal class JsonRequestSetLocation : JsonRequest
10 | {
11 | #region Fields and Properties
12 |
13 | public Location location { get; set; } = new Location();
14 |
15 | #endregion
16 |
17 | #region class
18 |
19 | public class Location
20 | {
21 | #region Fields and Properties
22 |
23 | public string city { get; set; }
24 | public string country { get; set; }
25 | public double loc_accuracy { get; set; }
26 | public Coordinates loc_coordinates { get; set; } = new Coordinates();
27 | public string name { get; set; }
28 | #endregion
29 | }
30 |
31 | public class Coordinates
32 | {
33 | #region Fields and Properties
34 |
35 | public double lat { get; set; }
36 | public double lng { get; set; }
37 |
38 | #endregion
39 | }
40 |
41 | #endregion
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonJodelsFirstRound.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace JodelAPI.Json.Response
4 | {
5 | internal class JsonJodelsFirstRound
6 | {
7 | public class LocCoordinates : JsonPostJodels.LocCoordinates { }
8 |
9 | public class Location : JsonPostJodels.Location { }
10 |
11 | public class ImageHeaders : JsonPostJodels.ImageHeaders { }
12 |
13 | public class Recent : JsonPostJodels.Post { }
14 |
15 | public class LocCoordinates2 : JsonPostJodels.LocCoordinates { }
16 |
17 | public class Location2 : JsonPostJodels.Location { }
18 |
19 | public class ImageHeaders2 : JsonPostJodels.ImageHeaders { }
20 |
21 | public class Replied : JsonPostJodels.Post { }
22 |
23 | public class LocCoordinates3 : JsonPostJodels.LocCoordinates { }
24 |
25 | public class Location3 : JsonPostJodels.Location { }
26 |
27 | public class Voted : JsonPostJodels.Post { }
28 |
29 | public class RootObject
30 | {
31 | public List recent { get; set; }
32 | public List replied { get; set; }
33 | public List voted { get; set; }
34 | public int max { get; set; }
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPITests/JodelTests.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using JodelAPI;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using JodelAPI.Shared;
9 |
10 | namespace JodelAPI.Tests
11 | {
12 | [TestClass()]
13 | public class JodelTests
14 | {
15 | Jodel jodel = new Jodel("Zuerich Schweiz", "CH", "Zuerich");
16 |
17 |
18 | [TestMethod()]
19 | public void GetKarmaTest()
20 | {
21 | int karma = jodel.GetKarma();
22 | }
23 |
24 | [TestMethod()]
25 | public void GetRecommendedChannelsTest()
26 | {
27 | Assert.IsNotNull(jodel.GetRecommendedChannels());
28 | }
29 |
30 | [TestMethod()]
31 | public void GetPostLocationComboTest()
32 | {
33 | Assert.IsNotNull(jodel.GetPostLocationCombo());
34 | }
35 |
36 | [TestMethod()]
37 | public void ShareUrlProperty()
38 | {
39 | var combo = jodel.GetPostLocationCombo();
40 | string url = combo.RecentJodels[1].ShareUrl;
41 | Uri uriResult;
42 | bool result = Uri.TryCreate(url, UriKind.Absolute, out uriResult)
43 | && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
44 | Assert.IsTrue(result);
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Shared/Channel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Shared
8 | {
9 | public class Channel
10 | {
11 | #region Fields and Properties
12 |
13 | public string ChannelName { get; private set; }
14 |
15 | public bool Following { get; private set; }
16 |
17 | public string ImageUrl { get; set; }
18 |
19 | public int Followers { get; set; }
20 |
21 | public bool Sponsored { get; set; }
22 |
23 | public bool Unread { get; set; }
24 |
25 | #endregion
26 |
27 | #region Constructor
28 |
29 |
30 | public Channel(string channelName, bool following = false)
31 | {
32 | ChannelName = channelName;
33 | Following = following;
34 | }
35 |
36 | #endregion
37 |
38 | #region Methods
39 |
40 | internal Channel UpdateProperties(string imageUrl, int followers)
41 | {
42 | ImageUrl = imageUrl;
43 | Followers = followers;
44 | return this;
45 | }
46 | internal Channel UpdateProperties(int followers, bool sponsored, bool unread)
47 | {
48 | Unread = unread;
49 | Followers = followers;
50 | Sponsored = sponsored;
51 | return this;
52 | }
53 |
54 | #endregion
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JodelAPI", "JodelAPI\JodelAPI.csproj", "{2FE543A6-F341-49D3-9CFD-98559341C69C}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JodelAPITests", "JodelAPITests\JodelAPITests.csproj", "{F10ED5B5-3F17-44F0-950F-2F323D9B0A48}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {2FE543A6-F341-49D3-9CFD-98559341C69C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {2FE543A6-F341-49D3-9CFD-98559341C69C}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {2FE543A6-F341-49D3-9CFD-98559341C69C}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {2FE543A6-F341-49D3-9CFD-98559341C69C}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {F10ED5B5-3F17-44F0-950F-2F323D9B0A48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {F10ED5B5-3F17-44F0-950F-2F323D9B0A48}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {F10ED5B5-3F17-44F0-950F-2F323D9B0A48}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {F10ED5B5-3F17-44F0-950F-2F323D9B0A48}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPITests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("JodelAPITests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("JodelAPITests")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f10ed5b5-3f17-44f0-950f-2f323d9b0a48")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Request/JsonRequestPostJodel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace JodelAPI.Json.Request
8 | {
9 | internal class JsonRequestPostJodel : JsonRequest
10 | {
11 | #region Fields and Properties
12 |
13 | public string ancestor { get; set; } = null;
14 | public string color { get; set; }
15 | public Location location { get; set; } = new Location();
16 | public string message { get; set; }
17 | public bool to_home { get; set; }
18 | public string image { get; set; }
19 |
20 | #endregion
21 |
22 | #region Methods
23 |
24 | public bool ShouldSerializeImage()
25 | {
26 | return image != null;
27 | }
28 |
29 | #endregion
30 |
31 | #region Internal Classes
32 |
33 | internal class Location
34 | {
35 | #region Fields and Properties
36 |
37 | public string city { get; set; }
38 | public string country { get; set; }
39 | public double loc_accuracy { get; set; } = 0.0;
40 | public Position loc_coordinates { get; set; } = new Position();
41 | public string name { get; set; }
42 |
43 | #endregion
44 | }
45 |
46 | internal class Position
47 | {
48 | #region Fields and Properties
49 |
50 | public double lat { get; set; }
51 | public double lng { get; set; }
52 |
53 | #endregion
54 | }
55 |
56 | #endregion
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Allgemeine Informationen über eine Assembly werden über die folgenden
6 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
7 | // die einer Assembly zugeordnet sind.
8 | [assembly: AssemblyTitle("JodelAPI")]
9 | [assembly: AssemblyDescription("A .NET wrapper for the Jodel API")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Luca Marcelli")]
12 | [assembly: AssemblyProduct("JodelAPI")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
18 | // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
19 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
20 | [assembly: ComVisible(false)]
21 |
22 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
23 | [assembly: Guid("2fe543a6-f341-49d3-9cfd-98559341c69c")]
24 |
25 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
26 | //
27 | // Hauptversion
28 | // Nebenversion
29 | // Buildnummer
30 | // Revision
31 | //
32 | // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
33 | // übernehmen, indem Sie "*" eingeben:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("4.42.4")]
36 | [assembly: AssemblyFileVersion("4.42.4")]
37 |
--------------------------------------------------------------------------------
/JodelAPI/JodelAPI/Json/Response/JsonMyPins.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace JodelAPI.Json.Response
4 | {
5 | internal class JsonMyPins
6 | {
7 | public class LocCoordinates
8 | {
9 | public int lat { get; set; }
10 | public int lng { get; set; }
11 | }
12 |
13 | public class Location
14 | {
15 | public string name { get; set; }
16 | public LocCoordinates loc_coordinates { get; set; }
17 | }
18 |
19 | public class Post
20 | {
21 | public string post_id { get; set; }
22 | public string created_at { get; set; }
23 | public string message { get; set; }
24 | public int discovered_by { get; set; }
25 | public string updated_at { get; set; }
26 | public string post_own { get; set; }
27 | public int discovered { get; set; }
28 | public string voted { get; set; }
29 | public bool pinned { get; set; }
30 | public int pin_count { get; set; }
31 | public int distance { get; set; }
32 | public int child_count { get; set; }
33 | public List