[twitter-dev] Re: Uploading a Profile Image help

2010-09-03 Thread Shannon Whitley
This call was working fine for me using basic auth.  I've been
converting my code to oAuth on my test machine.  I now receive a 200
reply and the user's profile data, but the image is not updated.

On Aug 9, 8:33 am, MeltingIce meltingice8...@gmail.com wrote:
 I too am waiting for the profileimageAPI call to be fixed. I have
 checked the request and even dove into HTTP_Request2's internal code
 just to verify that the request is correct.  The only error I get back
 is 500 Internal Server Error.  No other hints or suggestions are
 present in the response header.  The images I am using are small and
 well within the limits.  Any update on when this may be working again?

 Thanks,
 Ryan

 On Aug 9, 11:07 am, Taylor Singletary taylorsinglet...@twitter.com
 wrote:



  Also a reminder: the Twitter API is at thehttp://api.twitter.comsubdomain.
  Twitter API has version numbers in the URL as well.

  The original poster in this thread is 
  usinghttp://twitter.com/account/update_profile_image.xmlwhenthey should be
  usinghttp://api.twitter.com/1/account/update_profile_image.xml

  And I'll echo what Tom has said: you should switch to using OAuth very soon
  or you'll find your script doesn't work at all in about 2 weeks.

  Taylor

  On Sun, Aug 8, 2010 at 10:28 PM, Raghu Prasad 
  prasad.ragh...@gmail.comwrote:

   On Sun, Aug 8, 2010 at 5:58 AM, marketingmaniac execut...@gmail.com
   wrote:
i use to have this app that suddenly doesn't work anymore,, it use to
work perfectly and now ,, hmm,,
any help would be appreciated,,

   Though I don't know a bit about VB, I can safely say that
   profileimagefunctionality of Twitter has been broken for
   many weeks. Updating profileimagehas not been working
   via API. If you check the past threads, you'd find that one
   of the Twitter developer is assigned the task of streamlining
   theimageupload functionality. I am also waiting for that to
   happen.

   Raghu

here is the code that update my users profile written in vb 2008/10
that worked flawlessly

'THE BUTTON I MADE TO INITIATE THE SUB CALLED UPLOADPROFILEIMAGE
Private Sub Button37_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button37.Click

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en


Re: [twitter-dev] Re: Uploading a Profile Image help

2010-09-03 Thread Raghu Prasad
On Sat, Sep 4, 2010 at 5:33 AM, Shannon Whitley
shannon.whit...@gmail.com wrote:
 This call was working fine for me using basic auth.  I've been
 converting my code to oAuth on my test machine.  I now receive a 200
 reply and the user's profile data, but the image is not updated.

 On Aug 9, 8:33 am, MeltingIce meltingice8...@gmail.com wrote:
 I too am waiting for the profileimageAPI call to be fixed. I have
 checked the request and even dove into HTTP_Request2's internal code
 just to verify that the request is correct.  The only error I get back
 is 500 Internal Server Error.  No other hints or suggestions are
 present in the response header.  The images I am using are small and
 well within the limits.  Any update on when this may be working again?


It is over a couple of months since this functionality is broken. Last heard,
someone was working on it. After that there is no news on this.
We all are still waiting for a response from Twitter developers on this issue.

Raghu

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en


[twitter-dev] Re: Uploading a Profile Image help

2010-08-09 Thread MeltingIce
I too am waiting for the profile image API call to be fixed. I have
checked the request and even dove into HTTP_Request2's internal code
just to verify that the request is correct.  The only error I get back
is 500 Internal Server Error.  No other hints or suggestions are
present in the response header.  The images I am using are small and
well within the limits.  Any update on when this may be working again?

Thanks,
Ryan

On Aug 9, 11:07 am, Taylor Singletary taylorsinglet...@twitter.com
wrote:
 Also a reminder: the Twitter API is at thehttp://api.twitter.comsubdomain.
 Twitter API has version numbers in the URL as well.

 The original poster in this thread is 
 usinghttp://twitter.com/account/update_profile_image.xmlwhen they should be
 usinghttp://api.twitter.com/1/account/update_profile_image.xml

 And I'll echo what Tom has said: you should switch to using OAuth very soon
 or you'll find your script doesn't work at all in about 2 weeks.

 Taylor

 On Sun, Aug 8, 2010 at 10:28 PM, Raghu Prasad prasad.ragh...@gmail.comwrote:



  On Sun, Aug 8, 2010 at 5:58 AM, marketingmaniac execut...@gmail.com
  wrote:
   i use to have this app that suddenly doesn't work anymore,, it use to
   work perfectly and now ,, hmm,,
   any help would be appreciated,,

  Though I don't know a bit about VB, I can safely say that
  profile image functionality of Twitter has been broken for
  many weeks. Updating profile image has not been working
  via API. If you check the past threads, you'd find that one
  of the Twitter developer is assigned the task of streamlining
  the image upload functionality. I am also waiting for that to
  happen.

  Raghu

   here is the code that update my users profile written in vb 2008/10
   that worked flawlessly

   'THE BUTTON I MADE TO INITIATE THE SUB CALLED UPLOADPROFILEIMAGE
   Private Sub Button37_Click_1(ByVal sender As System.Object, ByVal e As
   System.EventArgs) Handles Button37.Click


[twitter-dev] Re: Uploading a Profile Image help

2010-08-08 Thread Tom
That's a lot of code, but it's easier to debug this kind of issues if
you show the request to Twitter.

Tom

PS: You should switch to oAuth!


On Aug 8, 2:28 am, marketingmaniac execut...@gmail.com wrote:
 i use to have this app that suddenly doesn't work anymore,, it use to
 work perfectly and now ,, hmm,,
 any help would be appreciated,,

 here is the code that update my users profile written in vb 2008/10
 that worked flawlessly

 'THE BUTTON I MADE TO INITIATE THE SUB CALLED UPLOADPROFILEIMAGE
 Private Sub Button37_Click_1(ByVal sender As System.Object, ByVal e As
 System.EventArgs) Handles Button37.Click

         Dim photo As Byte()
         photo = IO.File.ReadAllBytes(Me.jpg)
         UploadProfileImage(photo, username:=(AnaisAlice20),
 pwd:=(pass99))

     End Sub

 'THE SUB WHICH THE BUTTON CALLED

  Public Shared Sub UploadProfileImage(ByVal photo As Byte(), ByVal
 username As String, ByVal pwd As String)
         'photo is just a byte array of the image data

         'Dim photo As Byte()
         photo = IO.File.ReadAllBytes(c:\me.jpg)
         Dim request As HttpWebRequest =
 DirectCast(HttpWebRequest.Create(http://twitter.com/account/
 update_profile_image.xml), HttpWebRequest)
 System.Net.ServicePointManager.Expect100Continue = False
         request.PreAuthenticate = True
         request.AllowWriteStreamBuffering = True

         Dim boundary As String = System.Guid.NewGuid().ToString()

         request.Credentials = New NetworkCredential(username, pwd)
         request.ContentType = String.Format(multipart/form-
 data;boundary={0}, boundary)
         request.Method = POST

         ' Build Contents for Post
         Dim header As String = --  boundary
         Dim footer As String = --  boundary  --

         Dim contents As New StringBuilder()

         ' Image
         contents.AppendLine(header)
         contents.AppendLine(String.Format(Content-Disposition:form-
 data); name=image); filename={0}, twitterProfilePhoto.jpg))
         contents.AppendLine(Content-Type: image/jpeg)
         contents.AppendLine()

 contents.AppendLine(System.Text.Encoding.GetEncoding(iso-8859-1).GetString(photo))

         ' Footer
         contents.AppendLine(footer)

         ' Data that is sent with the post
         Dim bytes As Byte() =
 Encoding.GetEncoding(iso-8859-1).GetBytes(contents.ToString())

         request.ContentLength = bytes.Length

         Using requestStream As Stream = request.GetRequestStream()
             requestStream.Write(bytes, 0, bytes.Length)
             requestStream.Flush()
             requestStream.Close()

             ' Using response As WebResponse = request.GetResponse()
             'Using reader As New
 StreamReader(response.GetResponseStream())
             'Dim s As String = reader.ReadToEnd()
             'End Using
             'End Using
         End Using
     End Sub