git-svn-id: https://source.geekisp.com/bleep/trunk/Twitterbot@57 a256dd88-e320-0410-9161-d397f098afaa

This commit is contained in:
tyler 2007-03-21 19:50:39 +00:00
parent e3b917fa6e
commit af495926f2
2 changed files with 4 additions and 2 deletions

View File

@ -178,13 +178,14 @@ public class Twitterbot
public static bool PostToTwitter(Feed feed, string post)
{
HttpWebRequest request = GenerateGetOrPostRequest(TwitterUrl, "POST", string.Format("status={0}", post),
feed.TwitterName, feed.TwitterPass);
HttpWebRequest request = null;
string returnString = string.Empty;
HttpWebResponse response = null;
try
{
request = GenerateGetOrPostRequest(TwitterUrl, "POST", string.Format("status={0}", post),
feed.TwitterName, feed.TwitterPass);
response = (HttpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream( );
StreamReader reader = new StreamReader(responseStream,Encoding.UTF8);
@ -315,6 +316,7 @@ public class Twitterbot
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(uriString);
httpRequest.Method = method;
httpRequest.UserAgent = "Twitterbot";
if (method.ToUpper() =="POST")
{

Binary file not shown.