Beispiel #1
0
        /// <summary>
        /// Add one Twitter depends on the WeiBeeType and PictureFile
        /// </summary>
        /// <returns>wei bo id</returns>
        public string Add()
        {
            if (string.IsNullOrEmpty(Token) || string.IsNullOrEmpty(TokenSecret))
            {
                return(string.Empty);
            }
            IWeiBee wb = WeiBeeFactory.CreateWeiBeeByType(WbType);

            wb.SetOAuth(Token, TokenSecret);
            string ret;

            if (PictureFileStream != null)
            {
                ret = wb.AddPicture(MessageText, PictureFileStream);
            }
            else if (string.IsNullOrEmpty(PictureFile))
            {
                ret = wb.AddTwitter(MessageText);
            }
            else
            {
                ret = wb.AddPicture(MessageText, PictureFile);
            }
            return(ret);
        }
Beispiel #2
0
 private void InitWeiBeeAdd(IWeiBee wb, string txt)
 {
     Token         = wb.GetOAuth().Token;
     TokenSecret   = wb.GetOAuth().TokenSecret;
     WbType        = wb.UserType;
     MessageText   = txt;
     ScheduledTime = DateTime.UtcNow;
 }
    void OpenAuthPage()
    {
        IWeiBee weibee = WeiBeeFactory.CreateWeiBeeByType(WeiBeeType.QQ);

        weibee.GetOAuth().SetCallbackUrl(callbackurl);
        string authenticationUrl = weibee.GetOAuth().AuthorizationLinkGet();

        Session[TokenSessionName]       = weibee.GetOAuth().Token;
        Session[TokenSecretSessionName] = weibee.GetOAuth().TokenSecret;
        Session["weibeetype"]           = weibee.UserType.ToString();
        Response.Redirect(authenticationUrl);
    }
Beispiel #4
0
 public WeiBeeAdd(IWeiBee wb, string txt, string pic)
 {
     PictureFile = pic;
     InitWeiBeeAdd(wb, txt);
 }
Beispiel #5
0
 public WeiBeeAdd(IWeiBee wb, string txt)
 {
     InitWeiBeeAdd(wb, txt);
 }