Example #1
0
        public static async Task <MatchResponse> SuperLike(this TinderClient client, string userId)
        {
            var url      = SuperLikeEndpoint.Replace("{UserId}", userId);
            var response = await new RestClient(url, client.XAuthToken).Post <MatchResponse>();

            return(response);
        }
Example #2
0
        public static async Task <MatchResponse> Like(this TinderClient client, string userId, long sNumber)
        {
            var url      = LikeEndpoint.Replace("{UserId}", userId);
            var content  = new StringContent("{\"s_number\":" + sNumber + "}");
            var response = await new RestClient(url, client.XAuthToken).Post <MatchResponse>(content);

            return(response);
        }
Example #3
0
        public static async Task <MatchedPerson> GetMatchProfile(this TinderClient client, string userId)
        {
            var url = UserEndpoint.Replace("{UserId}", userId);

            var response = await new RestClient(url, client.XAuthToken).Get <MatchedPerson>();

            return(response);
        }
Example #4
0
        public static async Task <Message> SendSongMessage(this TinderClient client, string matchId, ISongMessage song)
        {
            var url      = Message.Replace("{MatchId}", matchId);
            var response = await new RestClient(url, client.XAuthToken).Post <Message>(
                new { message = song.GetUri(), track_id = song.GetSongId(), type = "song" });

            return(response);
        }
Example #5
0
        public static async Task <Message> SendMessage(this TinderClient client, string matchId, string msg)
        {
            var url = Message.Replace("{MatchId}", matchId);

            var response = await new RestClient(url, client.XAuthToken).Post <Message>(new { message = msg });

            return(response);
        }
Example #6
0
        public static async Task MarkMessageAsSeen(this TinderClient client, string matchId, string messageId)
        {
            string url = SeenMessage
                         .Replace("{MatchId}", matchId)
                         .Replace("{MessageId}", messageId);

            await new RestClient(url, client.XAuthToken).Post();
        }
Example #7
0
        public static async Task <IList <MatchResponse.Match> > GetMessagedMatches(this TinderClient client, UrlQuery query)
        {
            query.Add("message", "1");
            var url = CurrentMatchesEndpoint + query.Generate();

            var response = await new RestClient(url, client.XAuthToken).Get <MatchesWrapper>();

            return(response.Matches);
        }
Example #8
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Sharp Tinder");

            client = new TinderClient();

            Login();
            GetUpdates();
        }
Example #9
0
        public static async Task <Message> SendGifMessage(this TinderClient client, string matchId, Uri GiphyLink)
        {
            var    url      = Message.Replace("{MatchId}", matchId);
            var    regex    = Regex.Match(GiphyLink.AbsoluteUri, @"https:\/\/media1\.giphy\.com\/media\/(.+)\/giphy\.gif");
            string gifId    = regex.Groups[1].Value;
            var    response = await new RestClient(url, client.XAuthToken).Post <Message>(
                new { message = GiphyLink, gif_id = gifId, type = "gif" });

            return(response);
        }
Example #10
0
        public static async Task <Profile> ChangeSearchPreferences(this TinderClient client, SearchPreferences pref)
        {
            var url      = ProfileEndpoint;
            var response = await new RestClient(url, client.XAuthToken).Post <Profile>(new
            {
                user = pref
            });

            return(response);
        }
Example #11
0
        public static async Task <Update> GetUpdates(this TinderClient client, DateTime updatedFrom = default(DateTime))
        {
            var obj = new
            {
                nudge = true,
                last_activity_date = updatedFrom.ToTinderString()
            };
            var response = await new RestClient(UpdatesEndpoint, client.XAuthToken).Post <Update>(obj);

            return(response);
        }
Example #12
0
        public static async Task <MessagePage> GetMessages(this TinderClient client, string matchId, UrlQuery query = null)
        {
            string url = Message.Replace("{MatchId}", matchId);

            if (query != null)
            {
                url += query.Generate();
            }

            var response = await new RestClient(url, client.XAuthToken).Get <MessagePage>();

            return(response);
        }
Example #13
0
        private static void ConfigureServices(HostBuilderContext hostContext, IServiceCollection services)
        {
            var tinderAuthToken = hostContext.Configuration.GetValue <string>("TinderClient:Token"); // X-Auth-Token

            if (string.IsNullOrEmpty(tinderAuthToken) || !Guid.TryParse(tinderAuthToken, out Guid tinderAuthTokenGuid))
            {
                throw new Exception("TinderClient:Token is missing in appsettings.json or the token is malformed");
            }

            var tinderClient = new TinderClient(tinderAuthTokenGuid);

            services.AddSingleton <ITinderClient>(tinderClient);
            services.AddHostedService <Worker>();
        }
Example #14
0
        static async Task Main(string[] args)
        {
            var client = new TinderClient("");

            // var resp = client.GetProfile();
            var metadata = await client.GetMetadata();

            var profile = await client.GetProfile();

            var recommendations = await client.GetMatchRecommendations();

            var matches = await client.GetMatches(new UrlQueryBuilder().AddMatchesCount(10).Build());

            var moreMatches = await client.GetMessagedMatches(new UrlQueryBuilder().AddMatchesCount(10).Build());

            var update = await client.GetUpdates(DateTime.Now.AddMonths(-5));
        }
Example #15
0
        public static async Task <Metadata> GetMetadata(this TinderClient tinderClient)
        {
            var response = await new RestClient(MetadataEndpoint, tinderClient.XAuthToken).Get <Metadata>();

            return(response);
        }
Example #16
0
 public static async Task ChangeUsername(this TinderClient client, string newUsername)
 {
     await new RestClient(UsernameEndpoint, client.XAuthToken).Put(new { username = newUsername });
 }
Example #17
0
 public static async Task ResetUsername(this TinderClient client)
 {
     await new RestClient(UsernameEndpoint, client.XAuthToken).Delete();
 }
Example #18
0
        public static async Task Unmatch(this TinderClient client, string matchID)
        {
            var url = UnmatchEndpoint.Replace("{MatchId}", matchID);

            await new RestClient(url, client.XAuthToken).Delete();
        }
Example #19
0
        public static async Task <Profile> GetProfile(this TinderClient tinderClient)
        {
            var response = await new RestClient(ProfileEndpoint, tinderClient.XAuthToken).Get <Profile>();

            return(response);
        }
Example #20
0
        public static async Task Pass(this TinderClient client, string userId)
        {
            var url = PassEndpoint.Replace("{UserId}", userId);

            await new RestClient(url, client.XAuthToken).Post();
        }
Example #21
0
        public static async Task <IList <RecommendedMatch> > GetMatchRecommendations(this TinderClient client)
        {
            var response = await new RestClient(MatchRecommendationsEndpoint, client.XAuthToken).Get <RecommendedMatches>();

            return(response.Results);
        }