TryAppendVertexXmlNode
(
Dictionary<String, Object> userValueDictionary,
Boolean includeStatistics,
Boolean userTweetedSearchTerm,
GraphMLXmlDocument graphMLXmlDocument,
Dictionary<String, TwitterUser> userIDDictionary,
out TwitterUser twitterUser
)
{
Debug.Assert(userValueDictionary != null);
Debug.Assert(graphMLXmlDocument != null);
Debug.Assert(userIDDictionary != null);
twitterUser = null;
String screenName, userID;
if (
!TwitterJsonUtil.TryGetJsonValueFromDictionary(userValueDictionary,
"screen_name", out screenName)
||
!TwitterJsonUtil.TryGetJsonValueFromDictionary(userValueDictionary,
"id_str", out userID)
)
{
return (false);
}
screenName = screenName.ToLower();
Boolean isFirstTweetForAuthor =
TwitterGraphMLUtil.TryAppendVertexXmlNode(
screenName, userID, graphMLXmlDocument, userIDDictionary,
out twitterUser);
if (isFirstTweetForAuthor)
{
TwitterGraphMLUtil.AppendCommonUserInformationFromValueDictionary(
userValueDictionary, graphMLXmlDocument, twitterUser);
if (includeStatistics)
{
TwitterGraphMLUtil.AppendUserStatisticsFromValueDictionary(
userValueDictionary, graphMLXmlDocument, twitterUser);
}
AppendTweetedSearchTermGraphMLAttributeValue(
graphMLXmlDocument, twitterUser, userTweetedSearchTerm);
}
return (true);
}