Skip to content

Commit

Permalink
socioboard 3.0 update
Browse files Browse the repository at this point in the history
socioboard 3.0 update
  • Loading branch information
swetasb committed Dec 28, 2017
1 parent c117c83 commit 6623fe0
Show file tree
Hide file tree
Showing 80 changed files with 50,530 additions and 110 deletions.
Binary file modified .vs/Socioboard/v14/.suo
Binary file not shown.
7 changes: 7 additions & 0 deletions src/Api.Socioboard/Controllers/GroupProfilesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public IActionResult DeleteProfile(long groupId, long userId, string profileId)
return Ok(GroupProfilesRepository.DeleteProfile(groupId, userId, profileId, _redisCache, dbr, _appSettings));
}

[HttpPost("IsPrimaryAcc")]
public IActionResult IsPrimaryAcc(long userId, string profileId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
return Ok(GroupProfilesRepository.IsPrimaryAccount(userId, profileId, dbr, _appSettings));
}

[HttpPost("AddSelectedProfiles")]
public IActionResult AddSelectedProfiles(long groupId, long userId)
{
Expand Down
19 changes: 19 additions & 0 deletions src/Api.Socioboard/Controllers/InstagramController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,24 @@ public IActionResult DeleteinstagramFeed(string profileId, string FeedId)
_DeleteistagramFeeds.Delete<Domain.Socioboard.Models.Mongo.InstagramFeed>(filter);
return Ok();
}

[HttpGet("Searchinsta")]
public IActionResult Searchinsta(string instagramId, string qury,string count)
{
count = "1";
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
string Searchdata = Repositories.InstagramRepository.Searchbyname(qury, instagramId, count, _appSettings, _redisCache, dbr);
return Ok(Searchdata);

}

[HttpPost("followpeople")]
public IActionResult followpeople(string instagramId ,string followingid)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
string Searchdata = Repositories.InstagramRepository.Followpeople( instagramId, followingid, _appSettings, _redisCache, dbr);
return Ok(Searchdata);

}
}
}
3 changes: 3 additions & 0 deletions src/Api.Socioboard/Controllers/NotificationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,8 @@ public IActionResult UpdateNotifications(long userId)


}



}
}
4 changes: 2 additions & 2 deletions src/Api.Socioboard/Repositories/FacebookRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1676,8 +1676,8 @@ public static List<MongoFbPostComment> FbPostComments(string postid, dynamic pos
List<Domain.Socioboard.Models.Mongo.facebookfeed> lstfacebookfeed = new List<Domain.Socioboard.Models.Mongo.facebookfeed>();
MongoRepository mongorepo = new MongoRepository("MongoFacebookFeed", settings);
var builder = Builders<MongoFacebookFeed>.Sort;
var sort = builder.Descending(t => t.EntryDate);
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.MongoFacebookFeed>(t => t.ProfileId.Equals(profileId), sort, skip, count);
var sort = builder.Descending(t => t.FeedDate);
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.MongoFacebookFeed>(t => t.ProfileId.Equals(profileId), sort, skip, 20);
var task = Task.Run(async () =>
{
return await result;
Expand Down
26 changes: 26 additions & 0 deletions src/Api.Socioboard/Repositories/GroupProfilesRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,32 @@ public static string DeleteProfile(long groupId, long userId, string profileId,
}
}

public static string IsPrimaryAccount(long userId, string profileId, Model.DatabaseRepository dbr, Helper.AppSettings _appSettings)
{
Domain.Socioboard.Models.User user = new User();
Domain.Socioboard.Models.Facebookaccounts fbAcc = dbr.Find<Domain.Socioboard.Models.Facebookaccounts>(t => t.FbUserId.Equals(profileId) && t.UserId == userId && t.IsActive).FirstOrDefault();
try
{
user = dbr.Find<Domain.Socioboard.Models.User>(t => t.Id.Equals(userId) && t.EmailId == fbAcc.EmailId && t.EmailValidateToken == "Facebook").FirstOrDefault();

}
catch (Exception ex)
{

}
if (user != null)
{

return "Primary Account";
}
else
{
return "Not Primary Account";
}

}


public static List<Domain.Socioboard.Models.profilesdetail> SearchProfileType(long groupId, string Profiletype, Helper.Cache _redisCache, Model.DatabaseRepository dbr)
{
try
Expand Down
27 changes: 27 additions & 0 deletions src/Api.Socioboard/Repositories/InstagramRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Socioboard.Instagram.App.Core;
using Socioboard.Instagram.Authentication;
using Socioboard.Instagram.Instagram.Core.MediaMethods;
using Socioboard.Instagram.Instagram.Core.RelationshipMethods;
using Socioboard.Instagram.Instagram.Core.UsersMethods;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -1135,5 +1136,31 @@ public static string ApiInstagramHttp(string url)
}

}

//public static string SearchastagData(string tag, string InstagramId, long groupId, Helper.AppSettings _appSettings, Helper.Cache _redisCache, Model.DatabaseRepository dbr)
//{
// Domain.Socioboard.Models.Instagramaccounts _Instagramaccounts = Repositories.InstagramRepository.getInstagramAccount(InstagramId, _redisCache, dbr);
// TagController objSearchtag = new TagController();
// string reta = objSearchtag.GetTagSearch(tag, _Instagramaccounts.AccessToken);
// return "";
//}

public static string Searchbyname(string quary, string InstagramId,string count, Helper.AppSettings _appSettings, Helper.Cache _redisCache, Model.DatabaseRepository dbr)
{
Domain.Socioboard.Models.Instagramaccounts _Instagramaccounts = Repositories.InstagramRepository.getInstagramAccount(InstagramId, _redisCache, dbr);
UserController objSearch = new UserController();
Relationship objfollw = new Relationship();
string reta = objSearch.GetUsersSearch(quary, count, _Instagramaccounts.AccessToken, InstagramId);
return reta;
}


public static string Followpeople(string InstagramId, string followingid, Helper.AppSettings _appSettings, Helper.Cache _redisCache, Model.DatabaseRepository dbr)
{
Domain.Socioboard.Models.Instagramaccounts _Instagramaccounts = Repositories.InstagramRepository.getInstagramAccount(InstagramId, _redisCache, dbr);
Relationship objfollw = new Relationship();
string respon = objfollw.FollowPost(followingid, _Instagramaccounts.AccessToken);
return respon ;
}
}
}
29 changes: 1 addition & 28 deletions src/Api.Socioboard/Repositories/RssNewsContentsRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,34 +205,7 @@ public static List<string> findUrl(string keywords)

}
}
//if (responce_Baskar.Contains(keywordslist))
//{
// try
// {
// string data = obj_reqest.getBetween(responce_Baskar, "<th>RSS Path</th>", "<div class=\"rss-right\">");
// string[] report = Regex.Split(data, "<tr>");
// foreach (string item in report)
// {
// try
// {
// if (item.Contains(keywordslist))
// {
// string[] value = Regex.Split(item, "<td>");
// url[3] = obj_reqest.getBetween(value[2], "href=\"", "\"");
// break;
// }
// }
// catch (Exception ex)
// {

// }
// }
// }
// catch (Exception ex)
// {

// }
//}


foreach (var itemurl in url)
{
Expand Down
Binary file modified src/Api.Socioboard/bin/Debug/net451/Api.Socioboard.exe
Binary file not shown.
Binary file modified src/Api.Socioboard/bin/Debug/net451/Api.Socioboard.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 6623fe0

Please sign in to comment.