Skip to content

Commit

Permalink
socioboard 3.0
Browse files Browse the repository at this point in the history
github Commit
----------------
-Youtube account adding isssue
-Phone number code with country name implemented
-Schedule modal ui issue fixed
-added new content studio module
-added trending content features in same module
-added most shared features in same module
-Automate Rss Feeds Issue fixed
-add Quick topics implementation in conetnt studio
-add Trending Content ui and functionality and new implementation
  • Loading branch information
socioboard committed Aug 16, 2017
1 parent 4597842 commit e5599a7
Show file tree
Hide file tree
Showing 231 changed files with 12,179 additions and 1,096 deletions.
Binary file modified .vs/Socioboard/v14/.suo
Binary file not shown.
7 changes: 7 additions & 0 deletions Socioboard.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SociobordRssDataServices",
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Socioboard.Pinterest", "src\Socioboard.Pinterest\Socioboard.Pinterest.xproj", "{6BC81427-68C6-4909-B07E-BDECC55D3FD7}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TwitterSearch", "src\TwitterSearch\TwitterSearch.xproj", "{35004A68-AB7F-4C8D-9B84-326FD1240985}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -88,6 +90,10 @@ Global
{6BC81427-68C6-4909-B07E-BDECC55D3FD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BC81427-68C6-4909-B07E-BDECC55D3FD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BC81427-68C6-4909-B07E-BDECC55D3FD7}.Release|Any CPU.Build.0 = Release|Any CPU
{35004A68-AB7F-4C8D-9B84-326FD1240985}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35004A68-AB7F-4C8D-9B84-326FD1240985}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35004A68-AB7F-4C8D-9B84-326FD1240985}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35004A68-AB7F-4C8D-9B84-326FD1240985}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -105,5 +111,6 @@ Global
{5FC6D7FB-CA38-4A7A-8BE0-3BC12DB0C065} = {1A66A2B3-C9AD-443C-9F4B-5B5A9FB18BE6}
{6E7ED109-FAB2-4931-A184-607B7F94AD5D} = {1A66A2B3-C9AD-443C-9F4B-5B5A9FB18BE6}
{6BC81427-68C6-4909-B07E-BDECC55D3FD7} = {1A66A2B3-C9AD-443C-9F4B-5B5A9FB18BE6}
{35004A68-AB7F-4C8D-9B84-326FD1240985} = {1A66A2B3-C9AD-443C-9F4B-5B5A9FB18BE6}
EndGlobalSection
EndGlobal
106 changes: 106 additions & 0 deletions src/Api.Socioboard/Controllers/AdvanceSearchController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Hosting;
using Api.Socioboard.Model;
using MongoDB.Driver;
using Microsoft.AspNetCore.Cors;
using Domain.Socioboard.Models.Mongo;

// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace Api.Socioboard.Controllers
{
[EnableCors("AllowAll")]
[Route("api/[controller]")]
public class AdvanceSearchController : Controller
{
public AdvanceSearchController(ILogger<AdvanceSearchController> logger, Microsoft.Extensions.Options.IOptions<Helper.AppSettings> settings, IHostingEnvironment env)
{
_logger = logger;
_appSettings = settings.Value;
_redisCache = new Helper.Cache(_appSettings.RedisConfiguration);
_env = env;
}
private readonly ILogger _logger;
private Helper.AppSettings _appSettings;
private Helper.Cache _redisCache;
private readonly IHostingEnvironment _env;



[HttpGet("GetYTAdvanceSearchData")]
public IActionResult GetYTAdvanceSearchData(Domain.Socioboard.Enum.NetworkType network, int skip, int count)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings);
if (skip + count < 100)
{
return Ok(Repositories.ContentStudioRepository.YuTubeAdvanceSerachData(network, _redisCache, _appSettings).Skip(skip).Take(count));
}
else
{
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort;
var sort = builder.Descending(t => t.totalShareCount);
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.networkType.Equals(network), sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
});
IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result;
return Ok(lstTwitterFeeds);
}
}


[HttpGet("GetSortByData")]
public IActionResult GetSortByData(string sortType, int skip, int count)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings);
if (skip + count < 200)
{
return Ok(Repositories.ContentStudioRepository.GetSortBy(sortType, _redisCache, _appSettings).Skip(skip).Take(count));
}
else
{
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort;
var sort = builder.Descending(t => t.totalShareCount);
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.twtShareCount != 0, sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
});
IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result;
return Ok(lstTwitterFeeds);
}
}


[HttpGet("QuickTopics")]
public IActionResult QuickTopics(Domain.Socioboard.Enum.NetworkType networkType, int skip, int count)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings);
if (skip + count < 100)
{
return Ok(Repositories.ContentStudioRepository.QuickTopicRepository(networkType, _redisCache, _appSettings).Skip(skip).Take(count));
}
else
{
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort;
var sort = builder.Descending(t => t.totalShareCount);
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.twtShareCount != 0, sort, skip, count);
var task = Task.Run(async () =>
{
return await result;
});
IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result;
return Ok(lstTwitterFeeds);
}
}
}
}
16 changes: 12 additions & 4 deletions src/Api.Socioboard/Controllers/BoardMeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ public IActionResult getTwitterFeeds(long boardId, int skip, int count)
MongoRepository boardrepo = new MongoRepository("MongoBoardTwtFeeds", _appSettings);
try
{
var result = boardrepo.Find<MongoBoardTwtFeeds>(t => t.Twitterprofileid.Equals(board.twitterHashTag)).ConfigureAwait(false);
var builder = Builders<MongoBoardTwtFeeds>.Sort;
var sort = builder.Descending(t => t.Publishedtime);
//var result = boardrepo.FindWithRange<MongoBoardTwtFeeds>(t => t.Twitterprofileid.Equals(board.twitterHashTag),sort,skip,count).ConfigureAwait(false); ;
var result = boardrepo.BoardFind<MongoBoardTwtFeeds>(t => t.Twitterprofileid.Equals(board.twitterHashTag)).ConfigureAwait(false);
var task = Task.Run(async () =>
{
return await result;
Expand Down Expand Up @@ -286,8 +289,10 @@ public IActionResult getInstagramFeeds(long boardId, int skip, int count)
try
{

var result = boardrepo.Find<MongoBoardInstagramFeeds>(t => t.Instagramaccountid.Equals(board.instagramHashTag)).ConfigureAwait(false);

var builder = Builders<MongoBoardInstagramFeeds>.Sort;
var sort = builder.Descending(t => t.Publishedtime);
//var result = boardrepo.FindWithRange<MongoBoardInstagramFeeds>(t => t.Instagramaccountid.Equals(board.instagramHashTag),sort,skip, count).ConfigureAwait(false);
var result = boardrepo.BoardFind<MongoBoardInstagramFeeds>(t => t.Instagramaccountid.Equals(board.instagramHashTag)).ConfigureAwait(false);
var task = Task.Run(async () =>
{
return await result;
Expand Down Expand Up @@ -315,7 +320,10 @@ public IActionResult getGplusfeeds(long boardId, string skip, string count)
try
{
//List<MongoBoardGplusFeeds> objBoardGplusPagefeeds = boardrepo.getBoardGplusfeedsbyrange(Guid.Parse(BoardGplusprofileId), Convert.ToInt32(_noOfDataToSkip), Convert.ToInt32(_noOfResultsFromTop));
var result = boardrepo.Find<MongoBoardGplusFeeds>(t => t.Gplusboardaccprofileid.Equals(board.gplusHashTag)).ConfigureAwait(false);
var builder = Builders<MongoBoardGplusFeeds>.Sort;
var sort = builder.Descending(t => t.Publishedtime);
//var result = boardrepo.FindWithRange<MongoBoardGplusFeeds>(t => t.Gplusboardaccprofileid.Equals(board.gplusHashTag),sort,Convert.ToInt32(skip),Convert.ToInt32(count)).ConfigureAwait(false);
var result = boardrepo.BoardFind<MongoBoardGplusFeeds>(t => t.Gplusboardaccprofileid.Equals(board.gplusHashTag)).ConfigureAwait(false);
var task = Task.Run(async () =>
{
return await result;
Expand Down
42 changes: 42 additions & 0 deletions src/Api.Socioboard/Controllers/ContentStudioController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Cors;
using Microsoft.Extensions.Logging;
using Domain.Socioboard.Interfaces.Services;
using Microsoft.AspNetCore.Hosting;
using Api.Socioboard.Model;

// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace Api.Socioboard.Controllers
{
[EnableCors("AllowAll")]
[Route("api/[controller]")]
public class ContentStudioController : Controller
{
// GET: api/values
public ContentStudioController(ILogger<UserController> logger, IEmailSender emailSender, IHostingEnvironment appEnv, Microsoft.Extensions.Options.IOptions<Helper.AppSettings> settings)
{
_logger = logger;
_emailSender = emailSender;
_appEnv = appEnv;
_appSettings = settings.Value;
_redisCache = new Helper.Cache(_appSettings.RedisConfiguration);
}
private readonly ILogger _logger;
private readonly IEmailSender _emailSender;
private readonly IHostingEnvironment _appEnv;
private Helper.AppSettings _appSettings;
private Helper.Cache _redisCache;

[HttpGet("GetAdvanceSearchData")]
public IActionResult GetAdvanceSearchData(string keywords)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
return Ok(Repositories.ContentStudioRepository.GetAdvanceSearchdata(keywords, _redisCache, _appSettings));
}
}
}
4 changes: 2 additions & 2 deletions src/Api.Socioboard/Controllers/GroupsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public IActionResult CreateGroup(Domain.Socioboard.Models.Groups group)
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
if (dbr.Find<Domain.Socioboard.Models.Groups>(t => t.adminId == group.adminId && t.groupName.Equals(group.groupName)).Count > 0)
{
return Ok("Group Name Already Exist");
return Ok("Team Name Already Exist");
}
group.createdDate = System.DateTime.UtcNow;
int res = dbr.Add<Domain.Socioboard.Models.Groups>(group);
Expand All @@ -69,7 +69,7 @@ public IActionResult IsGroupExist(string groupName, long userId)
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
if (dbr.Find<Domain.Socioboard.Models.Groups>(t => t.adminId == userId && t.groupName.Equals(groupName)).Count > 0)
{
return Ok("Group Name Already Exist");
return Ok("Team Name Already Exist");
}
return Ok("No Group Found With this Name.");
}
Expand Down
12 changes: 6 additions & 6 deletions src/Api.Socioboard/Controllers/RssFeedController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public IActionResult AddRssUrl(long userId, long groupId, string rssUrl, string
catch (Exception ex)
{
return Ok("This Url Does't Conatin Rss Feed");
}
}

DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
Domain.Socioboard.Models.RssFeedUrl _RssFeedUrl = Repositories.RssFeedRepository.AddRssUrl(rssUrl, dbr);
if (_RssFeedUrl != null)
string _RssFeedUrl = Repositories.RssFeedRepository.AddRssUrl(profileId, rssUrl, dbr);
if (_RssFeedUrl != "null")
{
string[] lstProfileIds = null;
if (profileId != null)
Expand All @@ -81,22 +81,22 @@ public IActionResult AddRssUrl(long userId, long groupId, string rssUrl, string
{
string prId = item.Substring(3, item.Length - 3);
Domain.Socioboard.Models.Facebookaccounts objFacebookAccount = Api.Socioboard.Repositories.FacebookRepository.getFacebookAccount(prId, _redisCache, dbr);
string ret = Repositories.RssFeedRepository.AddRssFeed(rssUrl, userId, _RssFeedUrl, prId, Domain.Socioboard.Enum.SocialProfileType.Facebook, "http://graph.facebook.com/" + objFacebookAccount.FbUserId + "/picture?type=small", objFacebookAccount.FbUserName, dbr, _appSettings);
string ret = Repositories.RssFeedRepository.AddRssFeed(rssUrl, userId, prId, Domain.Socioboard.Enum.SocialProfileType.Facebook, "http://graph.facebook.com/" + objFacebookAccount.FbUserId + "/picture?type=small", objFacebookAccount.FbUserName, dbr, _appSettings);

}

if (item.StartsWith("page"))
{
string prId = item.Substring(5, item.Length - 5);
Domain.Socioboard.Models.Facebookaccounts objFacebookAccount = Api.Socioboard.Repositories.FacebookRepository.getFacebookAccount(prId, _redisCache, dbr);
string ret = Repositories.RssFeedRepository.AddRssFeed(rssUrl, userId, _RssFeedUrl, prId, Domain.Socioboard.Enum.SocialProfileType.FacebookFanPage, "http://graph.facebook.com/" + objFacebookAccount.FbUserId + "/picture?type=small", objFacebookAccount.FbUserName, dbr, _appSettings);
string ret = Repositories.RssFeedRepository.AddRssFeed(rssUrl, userId, prId, Domain.Socioboard.Enum.SocialProfileType.FacebookFanPage, "http://graph.facebook.com/" + objFacebookAccount.FbUserId + "/picture?type=small", objFacebookAccount.FbUserName, dbr, _appSettings);

}
if (item.StartsWith("tw"))
{
string prId = item.Substring(3, item.Length - 3);
Domain.Socioboard.Models.TwitterAccount objTwitterAccount = Api.Socioboard.Repositories.TwitterRepository.getTwitterAccount(prId, _redisCache, dbr);
string ret = Repositories.RssFeedRepository.AddRssFeed(rssUrl, userId, _RssFeedUrl, prId, Domain.Socioboard.Enum.SocialProfileType.Twitter, objTwitterAccount.profileImageUrl, objTwitterAccount.twitterName, dbr, _appSettings);
string ret = Repositories.RssFeedRepository.AddRssFeed(rssUrl, userId, prId, Domain.Socioboard.Enum.SocialProfileType.Twitter, objTwitterAccount.profileImageUrl, objTwitterAccount.twitterName, dbr, _appSettings);

}
}
Expand Down
19 changes: 10 additions & 9 deletions src/Api.Socioboard/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1590,30 +1590,31 @@ public IActionResult UpdateUser(string firstName, string lastName, string userNa

if (user != null)
{

var uploads = string.Empty;
var filename = "";
var imgPath = "";
if (files != null && files.Length > 0)
{
var fileName = Microsoft.Net.Http.Headers.ContentDispositionHeaderValue.Parse(files.ContentDisposition).FileName.Trim('"');
// await file.s(Path.Combine(uploads, fileName));
imgPath = Microsoft.Net.Http.Headers.ContentDispositionHeaderValue
filename = Microsoft.Net.Http.Headers.ContentDispositionHeaderValue
.Parse(files.ContentDisposition)
.FileName
.Trim('"');
imgPath = _appEnv.WebRootPath + "\\upload" + $@"\{Domain.Socioboard.Helpers.SBHelper.RandomString(11) + '.' + fileName.Split('.')[1]}";
// size += file.Length;
var tempName = Domain.Socioboard.Helpers.SBHelper.RandomString(10) + '.' + fileName.Split('.')[1];
filename = _appEnv.WebRootPath + "\\upload" + $@"\{tempName}";
imgPath = filename;
uploads = _appSettings.ApiDomain + "/api/Media/get?id=" + $@"{tempName}";
try
{
using (FileStream fs = System.IO.File.Create(imgPath))
using (FileStream fs = System.IO.File.Create(filename))
{
files.CopyTo(fs);
fs.Flush();
user.ProfilePicUrl = imgPath;
}
user.ProfilePicUrl = uploads;
}
catch (Exception ex)
catch (System.Exception ex)
{

}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Api.Socioboard/Helper/FacebookHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static string FacebookComposeMessageRss(string message, string accessToke
var args = new Dictionary<string, object>();
args["message"] = message;
args["link"] = link;
ret = fb.Post("v2.0/" + FbUserId + "/feed", args).ToString();
ret = fb.Post("v2.7/" + FbUserId + "/feed", args).ToString();
var builders = Builders<BsonDocument>.Filter;
FilterDefinition<BsonDocument> filter = builders.Eq("strId", rssFeedId);
var update = Builders<BsonDocument>.Update.Set("Status", true);
Expand Down
Loading

0 comments on commit e5599a7

Please sign in to comment.