[twitter-dev] Re: BlackBerry, XAuth and twitterapime

2010-08-06 Thread Bess
If Twitter4J do not run on BB, which OAuth or xAuth lib do you use in
BB?

There is no other Java option in BB? You have to use J2ME in BB?

What about webos BB has announced?

Can I port my Java code from Android straight to BB? How much code re
factoring or rewrite I have to do to move from Android to BB?

On Aug 6, 10:23 am, "Ernandes Jr."  wrote:
> BB is powered by Java ME and some specific RIM Java APIs.
>
> On Fri, Aug 6, 2010 at 8:26 AM, David Francisco Tavárez <
>
>
>
> davidftava...@gmail.com> wrote:
> > Twitter4J do not run on BB.
>
> > 2010/8/6, Bess :
> > > I am able to use Twitter4J Oauth in Android SDK 2.1. Can you do the
> > > same on BB?
>
> > > Does BB has the same JAVA environment similar to Android? I assume
> > > J2SE is very different than Android Java?
>
> > > On Aug 5, 4:52 pm, BBTweet Media Player 
> > > wrote:
> > >> Ernandes,
>
> > >> Thanks for the response.  I am sure there is something small I am
> > >> doing wrong.  I did grab twitter4j and made a simple j2se app to make
> > >> sure I could use my consumer key and secret and XAuth worked.  So I
> > >> know my account is good at least.  I am now trying to hand code the
> > >> example onhttp://dev.twitter.com/pages/xauthtomake sure I can
> > >> properly encode a header. Everything worked fine using BASIC.  I do
> > >> not see why they had to make it so hard.
>
> > >> I am using the BB 5 and 6 OSs.
>
> > >> On Aug 5, 2:39 pm, "Ernandes Jr."  wrote:
>
> > >> > I do not have a BB to test the API. However, I have received some
> > >> > e-mails
> > >> > from people facing same problem as you. Some of them were making some
> > >> > small
> > >> > mistakes and then it worked, however, others did not have much
> > success.
> > >> > At
> > >> > this moment, I am trying to find the route cause of many problems with
> > >> > BB. I
> > >> > hope to find it soon and then release a fix for release 1.4.
>
> > >> > By the way. which is your BB's OS version?
>
> > >> > Regards,
> > >> > Ernandes
>
> > >> > On Thu, Aug 5, 2010 at 4:56 AM, Bess  wrote:
> > >> > > Which OAuth library did you use on your BB? Did you use the Java
> > >> > > library?
>
> > >> > > On Aug 4, 7:42 am, "Ernandes Jr."  wrote:
> > >> > > > Hi,
>
> > >> > > > I suggest you to get in touch to Twitter API ME support before
> > >> > > > replacing
> > >> > > > codes. Send an e-mail to supp...@twapime.com or check project's
> > >> > > > forum
> > >> > > page:http://kenai.com/projects/twitterapime/forums/forum
>
> > >> > > > Maybe your issues are already discussed there.
>
> > >> > > > Regards,
> > >> > > > Ernandes
>
> > >> > > > On Tue, Aug 3, 2010 at 9:21 PM, BBTweet Media Player <
> > >> > > bbtweetme...@gmail.com
>
> > >> > > > > wrote:
> > >> > > > > I am having a very difficult time trying to get XAuth working in
> > >> > > > > my
> > >> > > > > BlackBerry app.  I have downloaded twitterapime the hmacsha
> > >> > > > > ecodingand
> > >> > > > > Base64Ecoder did not seem to work for me so I replaced the
> > >> > > > > getSignature method in XAuthSigner with...
>
> > >> > > > > /**
> > >> > > > >         * 
> > >> > > > >         * Generate a signature from the given base string.
> > >> > > > >         * 
> > >> > > > >         * @param baseString Base string.
> > >> > > > >         * @param consumerSecret Consumer secret.
> > >> > > > >         * @param tokenSecret Token secret.
> > >> > > > >         * @return Signature.
> > >> > > > >         */
> > >> > > > >        private static String getSignature(String baseString,
> > >> > > > > String
> > >> > > > > consumerSecret,
> > >> > > > >                String tokenSecret) {
> > >> > > > > //              byte[] b = HMAC.getHmac(baseString,
> > consumerSecret
> > >> > > > > +
> > >> > > '&' +
> > >> > > > > tokenSecret);
> > >> > > > > //              //
> > >> > > > > //              return Base64Encoder.encode(b);
> > >> > > > >                String ret = null;
> > >> > > > >                try {
> > >> > > > >                        ret = hmacsha1(baseString, consumerSecret
> > +
> > >> > > > > '&'
> > >> > > +
> > >> > > > > tokenSecret);
> > >> > > > >                } catch (Exception e) {
> > >> > > > >                        new RuntimeException(e.getMessage());
> > >> > > > >                }
> > >> > > > >                return ret;
> > >> > > > >        }
>
> > >> > > > >        private static String hmacsha1(String key, String
> > message)
> > >> > > > >        throws CryptoTokenException,
> > >> > > CryptoUnsupportedOperationException,
> > >> > > > > IOException {
> > >> > > > >              HMACKey k = new HMACKey(key.getBytes());
> > >> > > > >              HMAC hmac = new HMAC(k, new SHA1Digest());
> > >> > > > >              hmac.update(message.getBytes());
> > >> > > > >              byte[] mac = hmac.getMAC();
> > >> > > > >              return Base64OutputStream.encodeAsString(mac, 0,
> > >> > > > > mac.length, false, false);
> > >> > > > >    }
>
> > >> > > > > and any  base 64 encodings with
> > >> > >

[twitter-dev] Re: OAuth singing on BlackBerry

2010-08-06 Thread Bess
You need Twitter to approve before you can use xAuth. xAuth is
different than OAuth.

Can I ask which xAuth library did you use on BB? Is that Java? not
J2ME

On Aug 6, 1:03 pm, BBTweet Media Player 
wrote:
> WHOOO! I got my first 200 getting an XAuth request token.
>
> I think the answer to my question is no, I am not expected to get the
> same signature the have in the XAuth example but it always the same on
> my device.  My final problem was I was not URL encoding the signature
> before placing it into the Authorization header.
>
> Thanks for all the help here hoping to things moving forward quicker.
> I spent way to long trying to figure that out.
>
> On Aug 6, 2:34 pm, BBTweet Media Player 
> wrote:
>
> > Tom,
>
> > Thanks for the reply.  That is what I tried to do here.  I used the
> > exact same values presented on the XAuth 
> > pagehttp://dev.twitter.com/pages/xauth.
> > Everything was exactly the same upto the point where I ran the HMAC-
> > SHA1 encoding
>
> > String signature = hmacsha1(signingSecret, baseString);
>
> > The signature was not the same as the signature the showed in the
> > example.  My first question is should it be if I run SHA1 encoding
> > will with the same input should it always return the exact same string
> > (I just do not know much about the encoding)?  If it should be the
> > exact same this means that my problem is definitively in the encoding
> > step.  If so can anyone see what I might be doing wrong in the signing
> > step...
>
> >         HMACKey k = new HMACKey(key.getBytes());
> >         HMAC hmac = new HMAC(k, new SHA1Digest());
> >         hmac.update(message.getBytes());
> >         byte[] mac = hmac.getMAC();
> >         return Base64OutputStream.encodeAsString(mac, 0, mac.length,
> > false, false);
>
> > Thanks,
> > Kevin
>
> > On Aug 6, 10:31 am, Tom  wrote:
>
> > > Hi,
>
> > > I don't have a java compiler ready so I can't test your code.
>
> > > The page about xAuth shows all steps between the start and the actual
> > > signature. Try reproducing every single one of these values. (Usually
> > > you can simply log all steps and then compare the results with the
> > > xauth page.)
>
> > > Tom
>
> > > On Aug 6, 2:56 am, BBTweet Media Player 
> > > wrote:
>
> > > > I am having a really tough time trying to figure out how to sign my
> > > > OAuth request.  I am trying to follow the example 
> > > > athttp://dev.twitter.com/pages/xauth
> > > > and my signature does not come out the same as it does in the
> > > > example...
>
> > > > I am doing
>
> > > > public static void xauth(){
> > > >         try {
> > > >             String twitter_url="https://api.twitter.com/oauth/
> > > > access_token";
> > > >             String oauth_consumer_key = "sGNxxnqgZRHUt6NunK3uw";
> > > >             String oauth_consumer_secret =
> > > > "5kEQypKe7lFHnufLtsocB1vAzO07xLFgp2Pc4sp2vk";
> > > >             String oauth_nonce =
> > > > "WLxsobj4rhS2xmCbaAeT4aAkRfx4vSHX4OnYpTE77hA";
> > > >             String oauth_signature_method = "HMAC-SHA1";
> > > >             String oauth_timestamp = "1276101652";
> > > >             String oauth_version = "1.0";
> > > >             String x_auth_mode = "client_auth";
> > > >             String x_auth_password = "%&123!aZ+()456242134";
> > > >             String x_auth_username = "tpFriendlyGiant";
>
> > > >             String postBody = "x_auth_mode="+x_auth_mode
> > > > +"&x_auth_password="+encodeUTF8(x_auth_password)+
> > > >                 "&x_auth_username="+encodeUTF8(x_auth_username);
>
> > > >             String baseString = "POST&"+encodeUTF8(twitter_url)+
> > > >                 "&oauth_consumer_key%3D"+oauth_consumer_key +
> > > >                 "%26oauth_nonce%3D"+oauth_nonce+
> > > >                 "%26oauth_signature_method%3D"+oauth_signature_method+
> > > >                 "%26oauth_timestamp%3D"+oauth_timestamp+
> > > >                 "%26oauth_version%3D"+oauth_version+
> > > >                 "%26"+encodeUTF8(postBody);
>
> > > >             String signingSecret = encodeUTF8(oauth_consumer_secret)
> > > > +"&";
>
> > > >             String signature = hmacsha1(signingSecret, baseString);
>
> > > >             String header = new StringBuffer("OAuth oauth_nonce=
> > > > \"").append(oauth_nonce).append("\", oauth_signature_method=\"")
> > > >                 .append(oauth_signature_method).append("\",
> > > > oauth_timestamp=\"").append(oauth_timestamp).append("\",
> > > > oauth_consumer_key=\"")
> > > >                 .append(oauth_consumer_key).append("\",
> > > > oauth_signature=\"").append(signature).append("\", oauth_version=\"")
> > > >                 .append(oauth_version).append("\"").toString();
>
> > > >             System.out.println("Header = " + header);
> > > >         } catch (CryptoTokenException e) {
> > > >             // TODO Auto-generated catch block
> > > >             e.printStackTrace();
> > > >         } catch (CryptoUnsupportedOperationException e) {
> > > >             // TODO A

[twitter-dev] vb.net update twitter profile

2010-08-06 Thread marketingmaniac
this function use to work,, now its doesnt ?  anyone know why?


Public Shared Function Account_UpdateProfileImage(ByVal username
As String, ByVal password As String, ByVal image As Byte(), ByVal
extension As ImageExtension) As String
Try
Dim s As String = String.Empty

System.Net.ServicePointManager.Expect100Continue = False

Dim updateRequest As HttpWebRequest =
DirectCast(HttpWebRequest.Create("http://twitter.com/account/
update_profile_image.xml"), HttpWebRequest)
updateRequest.PreAuthenticate = True
updateRequest.AllowWriteStreamBuffering = True

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

updateRequest.Credentials = New
NetworkCredential(username, password)
updateRequest.ContentType = [String].Format("multipart/
form-data;boundary={0}", boundary)
updateRequest.Method = "POST"

Dim header As String = "--" & boundary
Dim footer As String = "--" & boundary & "--"

Dim headers As New StringBuilder()

headers.AppendLine(header)

Select Case extension
Case (ImageExtension.PNG)
If True Then
headers.AppendLine([String].Format("Content-
Disposition:form-data); name=""image""); filename=""{0}""",
"image.png"))
headers.AppendLine("Content-Type: image/png")
Exit Select
End If
Case (ImageExtension.GIF)
If True Then
headers.AppendLine([String].Format("Content-
Disposition:form-data); name=""image""); filename=""{0}""",
"image.gif"))
headers.AppendLine("Content-Type: image/gif")
Exit Select
End If
Case (ImageExtension.JPEG)
If True Then
headers.AppendLine([String].Format("Content-
Disposition:form-data); name=""image""); filename=""{0}""",
"image.jpg"))
headers.AppendLine("Content-Type: image/jpeg")
Exit Select
End If
End Select

headers.AppendLine()
 
headers.AppendLine(System.Text.Encoding.GetEncoding("iso-8859-1").GetString(image))
headers.AppendLine(footer)

Dim contents As Byte() =
Encoding.GetEncoding("iso-8859-1").GetBytes(headers.ToString())

updateRequest.ContentLength = contents.Length

Using requestStream As Stream =
updateRequest.GetRequestStream()
requestStream.Write(contents, 0, contents.Length)
requestStream.Flush()
requestStream.Close()


Using webResponse As WebResponse =
updateRequest.GetResponse()
Using responseReader As New
StreamReader(webResponse.GetResponseStream())
s = responseReader.ReadToEnd()
End Using
End Using
End Using
Return (s)
Catch ex As Exception
Return (ex.Message)

End Try
End Function


[twitter-dev] Re: In Reply To

2010-08-06 Thread gloopymoop
For example - make a script which tracks a specific #hashtag you are
required to include to be in the chain, then each time it is mentioned
harvest the "in reply to" from that tag and keep it in a database
which can then be used to access that tweet later...

A rather roundabout way but will work i guess.

On Aug 6, 8:48 am, gloopymoop  wrote:
> Thankyou for your reply. I'm a little unsure as to how the streaming
> API method would work.. can you give me an example ? I would still
> have to create a local database of the chain, right?
>
> On Aug 6, 3:58 am, David  wrote:
>
>
>
> > Hey gloopymoop,
>
> > Like the original thread said, you can use the search API to search
> > for tweets to that particular user and check the in_reply_to_status_id
> > field. If you want to track the chain (ie all the replies to
> > @dtran320's reply to @gloopymoop's original tweet), then you have to
> > periodically search each user in the chain.
>
> > A more efficient way of achieving this would be to use the Track or
> > Follow streaming API methods and add one users as they join the reply
> > chain:http://dev.twitter.com/pages/streaming_api_methods#follow
>
> > On Aug 3, 6:49 pm, gloopymoop  wrote:> I believe this 
> > has been discussed before here, so forgive me if this
> > > is redundant.
>
> > >http://groups.google.com/group/twitter-development-talk/browse_thread...
>
> > > I would like to build a chain of replies originating from a single
> > > tweet.
>
> > > The user will look at the first tweet, then be presented with the
> > > replies to this tweet and be able to move along the chain from the
> > > head down the branches.
>
> > > What would be the best way of implementing this? Requiring users to
> > > include a hashtag then periodically searching and keeping a local
> > > database of which tweets are in_reply_to which?


Re: [twitter-dev] Re: What do the attributes represent in a geo place lookup for a city

2010-08-06 Thread Matt Harris
Thanks for the bump on this one. I haven't published them to the website yet
but will get them out next week.

On Fri, Aug 6, 2010 at 2:58 PM, Carlos  wrote:

> Was the mentioned document completed?
>
> On Jul 13, 10:13 pm, Ryan W  wrote:
> > Thanks Matt, I'll look forward to the doc updates.
> >
> > On Jul 12, 11:05 pm, Matt Harris  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Great questions. I'll be publishing a document to dev.twitter.comabout 
> > > this
> > > in the next couple of days but to answer you question theattributesyou
> > > refer to are specific to a registered OAuth application. I'll explain
> more
> > > about theseattributesand where they come from in the dev.twitter
> document.
> >
> > > I'll let you know when the document is published.
> >
> > > Matt
> >
> > > On Mon, Jul 12, 2010 at 6:07 PM, Ryan W  wrote:
> > > > For example:
> >
> > > >Placelookup for Portland, OR:
> > > >http://api.twitter.com/1/geo/id/ac88a4f17a51c7fc.json
> >
> > > > Returns as part of the result:
> >
> > > > "attributes":{"162772:pop100":"529121","162772:place_id":"4159000"}
> >
> > > > What does the 162772 signify?  I believe the "162772:pop100"
> > > > represents population from 2000 census (I'm saying 2000 based on spot
> > > > checking a couple of cities).  But, will this 162772 change?
> >
> > > > What does the place_id represent?  It's not a woeid, and it's
> > > > different than the twitter place_id (or is it?  maybe the place_id in
> > > > the URL is a hash of this?)
> >
> > > > Thanks!
> >
> > > --
> >
> > > Matt Harris
> > > Developer Advocate, Twitterhttp://twitter.com/themattharris
>



-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


Re: [twitter-dev] Callback URL not authorized issue

2010-08-06 Thread Dana Contreras
Hi Steve,

Our OAuth implementation is very strict about host names and will not
authorize callbacks unless the host name matches exactly. In your
case, the www subdomain is the difference.

You can make your @Anywhere app work on both host names by adding
mymobileplanet.co.uk (without the www) to your list of authorized
domains. Go to http://dev.twitter.com/apps, click on the name of your
@Anywhere app, and then click on Manage Domains in the right sidebar.
Enter mymobileplanet.co.uk into the form field and click Authorize.

On Fri, Aug 6, 2010 at 10:56 AM, Steve  wrote:
> I have implemented @Anywhere on a web-page. I have registered an app
> with Twitter and inserted the API key in the head section and both
> modules in the body section of my page.
>
> I am getting the following error:
>
> The provided callback url http://mymobileplanet.co.uk/iPhone.html is
> not authorized for the client registered to 'http://
> www.mymobileplanet.co.uk'.
>
> I have tried several methods to somehow make it work but all in vain.
>
> I would appreciate if someone can visit my pages and see what the
> problem is or guide me how I can make it work.
>



-- 
Dana Contreras
Twitter Platform Team
http://twitter.com/DanaDanger


[twitter-dev] Re: DMs and followers list

2010-08-06 Thread Mark Krieger
Thank you, exactly what I wanted to know,

Mark

On Aug 6, 1:22 pm, Matt Harris  wrote:
> Hi Mark,
>
> In the Twitter direct message composition screen we display an alphabetised
> list of up to 100 of the most recent users you sent direct messages to.
>
> Hope that helps,
> Matt
>
> On Wed, Aug 4, 2010 at 12:38 PM, Mark Krieger wrote:
>
>
>
> > Thanks, one of my colleagues, who is more ajax-savvy than me,
> > suggested similar just a few
> > minutes ago.
>
> > I appreciate your advice. We will do this, but I probably not top
> > priority.
>
> > I still wonder what twitter does, since someone I know who does have
> > many followers could not
> > explain what twitter does with his DM followers dropdown
>
> > Thanks again,
>
> > Mark
>
> > On Aug 4, 11:40 am, Marcelo Calbucci  wrote:
> > > Mark, you should implement similarly to what Google Auto-suggest does...
> > As
> > > users start typing they send AJAX calls back to the servers that return
> > the
> > > top 10 matches. As long as your server responds quickly, users are not
> > going
> > > to notice because the total latency might be 100 or 200ms, which would
> > > enough to keep users happy.
>
> > > -Marcelo
>
> > > On Wed, Aug 4, 2010 at 6:32 AM, Mark Krieger 
> > wrote:
> > > > I am working on a twitter application, I want followers to be kept in
> > > > a dropdown in my application like twitter does when I send a DM from
> > > > twitter. However, since I have less than 50 followers now (alas), I do
> > > > not know the twitter behavior when someone has (let's say) 5000 or
> > > > 1 or even 10 followers. Surely you do not put a gigantic list
> > > > into that dropdown. But since I cannot test that situation, can
> > > > someone tell me what twitter itself does? I'd like to more or less do
> > > > the same as twitter in this case.
>
> > > > thanks,
>
> > > > Mark
>
> > > --
> > > -Marcelo
>
> > > Twitter: @calbucci  | blog.calbucci.com |
> > Seattle
> > > 2.0 
>
> --
>
> Matt Harris
> Developer Advocate, Twitterhttp://twitter.com/themattharris


[twitter-dev] Re: Callback URL not authorized issue

2010-08-06 Thread Steve
Thanks Brian. If anyone else can check if the follow me and the
twitter box is working fine on my page. The apps are still giving me
the same error as mentioned above.

On Aug 5, 11:09 pm, Brian Fromme  wrote:
> I was able to click right in to the page from my black jack, which is good. 
> Half the links in cyberspace don't usually come mobile windows based!
>
> -Original Message-
> From: Steve 
> Sent: Friday, August 06, 2010 1:56 PM
> To: Twitter Development Talk 
> Subject: [twitter-dev] Callback URL not authorized issue
>
> I have implemented @Anywhere on a web-page. I have registered an app
> with Twitter and inserted the API key in the head section and both
> modules in the body section of my page.
>
> I am getting the following error:
>
> The provided callback urlhttp://mymobileplanet.co.uk/iPhone.htmlis
> not authorized for the client registered to 'http://www.mymobileplanet.co.uk'.
>
> I have tried several methods to somehow make it work but all in vain.
>
> I would appreciate if someone can visit my pages and see what the
> problem is or guide me how I can make it work.


[twitter-dev] Re: What do the attributes represent in a geo place lookup for a city

2010-08-06 Thread Carlos
Was the mentioned document completed?

On Jul 13, 10:13 pm, Ryan W  wrote:
> Thanks Matt, I'll look forward to the doc updates.
>
> On Jul 12, 11:05 pm, Matt Harris  wrote:
>
>
>
>
>
>
>
> > Great questions. I'll be publishing a document to dev.twitter.com about this
> > in the next couple of days but to answer you question theattributesyou
> > refer to are specific to a registered OAuth application. I'll explain more
> > about theseattributesand where they come from in the dev.twitter document.
>
> > I'll let you know when the document is published.
>
> > Matt
>
> > On Mon, Jul 12, 2010 at 6:07 PM, Ryan W  wrote:
> > > For example:
>
> > >Placelookup for Portland, OR:
> > >http://api.twitter.com/1/geo/id/ac88a4f17a51c7fc.json
>
> > > Returns as part of the result:
>
> > > "attributes":{"162772:pop100":"529121","162772:place_id":"4159000"}
>
> > > What does the 162772 signify?  I believe the "162772:pop100"
> > > represents population from 2000 census (I'm saying 2000 based on spot
> > > checking a couple of cities).  But, will this 162772 change?
>
> > > What does the place_id represent?  It's not a woeid, and it's
> > > different than the twitter place_id (or is it?  maybe the place_id in
> > > the URL is a hash of this?)
>
> > > Thanks!
>
> > --
>
> > Matt Harris
> > Developer Advocate, Twitterhttp://twitter.com/themattharris


[twitter-dev] Re: OAuth singing on BlackBerry

2010-08-06 Thread BBTweet Media Player
WHOOO! I got my first 200 getting an XAuth request token.

I think the answer to my question is no, I am not expected to get the
same signature the have in the XAuth example but it always the same on
my device.  My final problem was I was not URL encoding the signature
before placing it into the Authorization header.

Thanks for all the help here hoping to things moving forward quicker.
I spent way to long trying to figure that out.


On Aug 6, 2:34 pm, BBTweet Media Player 
wrote:
> Tom,
>
> Thanks for the reply.  That is what I tried to do here.  I used the
> exact same values presented on the XAuth 
> pagehttp://dev.twitter.com/pages/xauth.
> Everything was exactly the same upto the point where I ran the HMAC-
> SHA1 encoding
>
> String signature = hmacsha1(signingSecret, baseString);
>
> The signature was not the same as the signature the showed in the
> example.  My first question is should it be if I run SHA1 encoding
> will with the same input should it always return the exact same string
> (I just do not know much about the encoding)?  If it should be the
> exact same this means that my problem is definitively in the encoding
> step.  If so can anyone see what I might be doing wrong in the signing
> step...
>
>         HMACKey k = new HMACKey(key.getBytes());
>         HMAC hmac = new HMAC(k, new SHA1Digest());
>         hmac.update(message.getBytes());
>         byte[] mac = hmac.getMAC();
>         return Base64OutputStream.encodeAsString(mac, 0, mac.length,
> false, false);
>
> Thanks,
> Kevin
>
> On Aug 6, 10:31 am, Tom  wrote:
>
> > Hi,
>
> > I don't have a java compiler ready so I can't test your code.
>
> > The page about xAuth shows all steps between the start and the actual
> > signature. Try reproducing every single one of these values. (Usually
> > you can simply log all steps and then compare the results with the
> > xauth page.)
>
> > Tom
>
> > On Aug 6, 2:56 am, BBTweet Media Player 
> > wrote:
>
> > > I am having a really tough time trying to figure out how to sign my
> > > OAuth request.  I am trying to follow the example 
> > > athttp://dev.twitter.com/pages/xauth
> > > and my signature does not come out the same as it does in the
> > > example...
>
> > > I am doing
>
> > > public static void xauth(){
> > >         try {
> > >             String twitter_url="https://api.twitter.com/oauth/
> > > access_token";
> > >             String oauth_consumer_key = "sGNxxnqgZRHUt6NunK3uw";
> > >             String oauth_consumer_secret =
> > > "5kEQypKe7lFHnufLtsocB1vAzO07xLFgp2Pc4sp2vk";
> > >             String oauth_nonce =
> > > "WLxsobj4rhS2xmCbaAeT4aAkRfx4vSHX4OnYpTE77hA";
> > >             String oauth_signature_method = "HMAC-SHA1";
> > >             String oauth_timestamp = "1276101652";
> > >             String oauth_version = "1.0";
> > >             String x_auth_mode = "client_auth";
> > >             String x_auth_password = "%&123!aZ+()456242134";
> > >             String x_auth_username = "tpFriendlyGiant";
>
> > >             String postBody = "x_auth_mode="+x_auth_mode
> > > +"&x_auth_password="+encodeUTF8(x_auth_password)+
> > >                 "&x_auth_username="+encodeUTF8(x_auth_username);
>
> > >             String baseString = "POST&"+encodeUTF8(twitter_url)+
> > >                 "&oauth_consumer_key%3D"+oauth_consumer_key +
> > >                 "%26oauth_nonce%3D"+oauth_nonce+
> > >                 "%26oauth_signature_method%3D"+oauth_signature_method+
> > >                 "%26oauth_timestamp%3D"+oauth_timestamp+
> > >                 "%26oauth_version%3D"+oauth_version+
> > >                 "%26"+encodeUTF8(postBody);
>
> > >             String signingSecret = encodeUTF8(oauth_consumer_secret)
> > > +"&";
>
> > >             String signature = hmacsha1(signingSecret, baseString);
>
> > >             String header = new StringBuffer("OAuth oauth_nonce=
> > > \"").append(oauth_nonce).append("\", oauth_signature_method=\"")
> > >                 .append(oauth_signature_method).append("\",
> > > oauth_timestamp=\"").append(oauth_timestamp).append("\",
> > > oauth_consumer_key=\"")
> > >                 .append(oauth_consumer_key).append("\",
> > > oauth_signature=\"").append(signature).append("\", oauth_version=\"")
> > >                 .append(oauth_version).append("\"").toString();
>
> > >             System.out.println("Header = " + header);
> > >         } catch (CryptoTokenException e) {
> > >             // TODO Auto-generated catch block
> > >             e.printStackTrace();
> > >         } catch (CryptoUnsupportedOperationException e) {
> > >             // TODO Auto-generated catch block
> > >             e.printStackTrace();
> > >         } catch (IOException e) {
> > >             // TODO Auto-generated catch block
> > >             e.printStackTrace();
> > >         }
> > >     }
>
> > >     private static String hmacsha1(String key, String message) throws
> > > CryptoTokenException,
> > >         CryptoUnsupportedOperationException, IOExcep

[twitter-dev] Re: Get resolved URLs?

2010-08-06 Thread Tom
I agree - it would be nice to have this. Possibly as an entity?


Tom


On Aug 6, 6:35 pm, Brian Medendorp  wrote:
> I can see that twitter itself must be resolving any shortened URLs
> somewhere, because if you search for a domain name (such as
> amazon.com), you get a bunch of results that don't seem to match until
> you resolve the shortened URL in the tweet and see that it points to
> the domain you searched for, which is fantastic!
>
> However, I am wondering if there is any way to get those resolved URLs
> from the API, or (better yet) if there is anyway that those URLs could
> be exposed in the search results themselves. Currently, I am resolving
> the URLs myself by requesting the URL and saving the resulting
> location, but that starts to take a while when there are a lot of
> results returned.


[twitter-dev] Re: I ask to debug [0] => array and list => Array

2010-08-06 Thread Tom
show_all_inline_media is, as far as I know, a setting that determines
whether to show images on /home, instead of standard urls like
twitpic.

Tom


On Aug 6, 8:15 pm, CWorster  wrote:
> Hi,
>
> > I wanted to know what the variable
>
> here's a list about return values I found in the "old" 
> Api-Wikihttp://apiwiki.twitter.com/Return-Values. Unfortunately not all values
> are described (e.g. "show_all_inline_media").
>
> Cheers
>
> Christian


RE: [twitter-dev] Callback URL not authorized issue

2010-08-06 Thread Brian Fromme
I was able to click right in to the page from my black jack, which is good. 
Half the links in cyberspace don't usually come mobile windows based!

-Original Message-
From: Steve 
Sent: Friday, August 06, 2010 1:56 PM
To: Twitter Development Talk 
Subject: [twitter-dev] Callback URL not authorized issue

I have implemented @Anywhere on a web-page. I have registered an app
with Twitter and inserted the API key in the head section and both
modules in the body section of my page.

I am getting the following error:

The provided callback url http://mymobileplanet.co.uk/iPhone.html is
not authorized for the client registered to 'http://
www.mymobileplanet.co.uk'.

I have tried several methods to somehow make it work but all in vain.

I would appreciate if someone can visit my pages and see what the
problem is or guide me how I can make it work.


Re: [twitter-dev] Re: How is this a solution?

2010-08-06 Thread Julio Biason
On Thu, Aug 5, 2010 at 8:41 PM, Taylor Singletary
 wrote:
> We know this isn't ideal.

No, it's not ideal: It's far far FAR from it.

> But we're supporting OAuth 1.0a right now, and for the safety of our users,
> for the ecosystem, and for you: please don't distribute API tokens and
> secrets in your open source projects.

Two wrongs here: First of all, you're saying that closed source apps
are safer for your users ('cause, in theory, the keys are harder to
get). That's false 'cause you can't assure, nor your users and neither
the ecosystem that a certain application will "call home" and send
information it shouldn't. Even worse for the "ecosystem" is that you
guys are forcing applications to be removed from it.

The second wrong is that you're, basically, telling us that we should
punish our users with a more complicated UX because we decided to
provide them with more freedom.

I may sound pissed and I am: Twitter was build on top of open source
apps (like Rails and now Cassandra) and basically you guys are
slapping every other open source application that use your APIs in the
face.

-- 
Julio Biason 
Twitter: http://twitter.com/juliobiason


[twitter-dev] Re: OAuth singing on BlackBerry

2010-08-06 Thread BBTweet Media Player
Tom,

Thanks for the reply.  That is what I tried to do here.  I used the
exact same values presented on the XAuth page 
http://dev.twitter.com/pages/xauth.
Everything was exactly the same upto the point where I ran the HMAC-
SHA1 encoding

String signature = hmacsha1(signingSecret, baseString);

The signature was not the same as the signature the showed in the
example.  My first question is should it be if I run SHA1 encoding
will with the same input should it always return the exact same string
(I just do not know much about the encoding)?  If it should be the
exact same this means that my problem is definitively in the encoding
step.  If so can anyone see what I might be doing wrong in the signing
step...

HMACKey k = new HMACKey(key.getBytes());
HMAC hmac = new HMAC(k, new SHA1Digest());
hmac.update(message.getBytes());
byte[] mac = hmac.getMAC();
return Base64OutputStream.encodeAsString(mac, 0, mac.length,
false, false);

Thanks,
Kevin

On Aug 6, 10:31 am, Tom  wrote:
> Hi,
>
> I don't have a java compiler ready so I can't test your code.
>
> The page about xAuth shows all steps between the start and the actual
> signature. Try reproducing every single one of these values. (Usually
> you can simply log all steps and then compare the results with the
> xauth page.)
>
> Tom
>
> On Aug 6, 2:56 am, BBTweet Media Player 
> wrote:
>
> > I am having a really tough time trying to figure out how to sign my
> > OAuth request.  I am trying to follow the example 
> > athttp://dev.twitter.com/pages/xauth
> > and my signature does not come out the same as it does in the
> > example...
>
> > I am doing
>
> > public static void xauth(){
> >         try {
> >             String twitter_url="https://api.twitter.com/oauth/
> > access_token";
> >             String oauth_consumer_key = "sGNxxnqgZRHUt6NunK3uw";
> >             String oauth_consumer_secret =
> > "5kEQypKe7lFHnufLtsocB1vAzO07xLFgp2Pc4sp2vk";
> >             String oauth_nonce =
> > "WLxsobj4rhS2xmCbaAeT4aAkRfx4vSHX4OnYpTE77hA";
> >             String oauth_signature_method = "HMAC-SHA1";
> >             String oauth_timestamp = "1276101652";
> >             String oauth_version = "1.0";
> >             String x_auth_mode = "client_auth";
> >             String x_auth_password = "%&123!aZ+()456242134";
> >             String x_auth_username = "tpFriendlyGiant";
>
> >             String postBody = "x_auth_mode="+x_auth_mode
> > +"&x_auth_password="+encodeUTF8(x_auth_password)+
> >                 "&x_auth_username="+encodeUTF8(x_auth_username);
>
> >             String baseString = "POST&"+encodeUTF8(twitter_url)+
> >                 "&oauth_consumer_key%3D"+oauth_consumer_key +
> >                 "%26oauth_nonce%3D"+oauth_nonce+
> >                 "%26oauth_signature_method%3D"+oauth_signature_method+
> >                 "%26oauth_timestamp%3D"+oauth_timestamp+
> >                 "%26oauth_version%3D"+oauth_version+
> >                 "%26"+encodeUTF8(postBody);
>
> >             String signingSecret = encodeUTF8(oauth_consumer_secret)
> > +"&";
>
> >             String signature = hmacsha1(signingSecret, baseString);
>
> >             String header = new StringBuffer("OAuth oauth_nonce=
> > \"").append(oauth_nonce).append("\", oauth_signature_method=\"")
> >                 .append(oauth_signature_method).append("\",
> > oauth_timestamp=\"").append(oauth_timestamp).append("\",
> > oauth_consumer_key=\"")
> >                 .append(oauth_consumer_key).append("\",
> > oauth_signature=\"").append(signature).append("\", oauth_version=\"")
> >                 .append(oauth_version).append("\"").toString();
>
> >             System.out.println("Header = " + header);
> >         } catch (CryptoTokenException e) {
> >             // TODO Auto-generated catch block
> >             e.printStackTrace();
> >         } catch (CryptoUnsupportedOperationException e) {
> >             // TODO Auto-generated catch block
> >             e.printStackTrace();
> >         } catch (IOException e) {
> >             // TODO Auto-generated catch block
> >             e.printStackTrace();
> >         }
> >     }
>
> >     private static String hmacsha1(String key, String message) throws
> > CryptoTokenException,
> >         CryptoUnsupportedOperationException, IOException {
> >         HMACKey k = new HMACKey(key.getBytes());
> >         HMAC hmac = new HMAC(k, new SHA1Digest());
> >         hmac.update(message.getBytes());
> >         byte[] mac = hmac.getMAC();
> >         return Base64OutputStream.encodeAsString(mac, 0, mac.length,
> > false, false);
> >     }
>
> > Everything matches the example, but when they sign they get...
>
> > oauth_signature="yUDBrcMMm6ghqBEKCFKVoJPIacU%3D"
>
> > and I get...
>
> > MUYmiobRdoK6s0ZVqo4xQNNO17w=
>
> > Can anyone see anything I am doing wrong?
>
> > Thanks,
> > Kevin


Re: [twitter-dev] Re: I ask to debug [0] => array and list => Array

2010-08-06 Thread CWorster
Hi,

> I wanted to know what the variable

here's a list about return values I found in the "old" Api-Wiki
http://apiwiki.twitter.com/Return-Values. Unfortunately not all values
are described (e.g. "show_all_inline_media").

Cheers

Christian


[twitter-dev] Callback URL not authorized issue

2010-08-06 Thread Steve
I have implemented @Anywhere on a web-page. I have registered an app
with Twitter and inserted the API key in the head section and both
modules in the body section of my page.

I am getting the following error:

The provided callback url http://mymobileplanet.co.uk/iPhone.html is
not authorized for the client registered to 'http://
www.mymobileplanet.co.uk'.

I have tried several methods to somehow make it work but all in vain.

I would appreciate if someone can visit my pages and see what the
problem is or guide me how I can make it work.


Re: [twitter-dev] Re: I ask to debug [0] => array and list => Array

2010-08-06 Thread landmatrosen
hi tom

when I look at a JSON representation, I am a little confused
I read the data off and save them one part in a mysql database ..

I have found an explanation for dev.twitter.com ..

I wanted to know what the variable

many greetings from Germany

alexander friedland



2010/8/6 Tom 

> Sorry, but I have no idea what you are talking about.
>
> Please answer these questions :
> 1. What are you trying to achieve?
> 2. What is the Twitter data (json/xml) you get?
> 3. What is the actual problem?
>
> Tom
>
>
> On Aug 6, 3:15 pm, twiDDern  wrote:
> > Hello
> > sorry for the bad english!
> >
> > I ask to debug a [0] and array and list => Array
> > variable it shows me that I can not interpret correctly.
> > can someone give me a hint.
> > what are these variables?
> >
> > what is:
> >
> > 1st [following] >>> ([following] is not [friends_count]
> > 2nd [show_all_inline_media]
> > 3rd [follow_request_sent]>>>??
> > 4th [notifications] shows me when I get new DM?
> > 5th [geo] is the geotag? e.g. mobile phone?
> > 6th [coordinates], or is it the geotags?
> >
> > sorry, it might ask beginners, but for me a bit confusing.
> > thanks for your help
>



-- 
Alexander Friedland

www.alexander-friedland.de
www.twitter.com/fridolindd

twiDDern - Schnellere Infos haben nur Hellseher!
www.twiddern.de
www.dresden.twiddern.de
www.berlin.twiddern.de
www.hamburg.twiddern.de
www.leipzig.twiddern.de
www.chemnitz.twiddern.de
www.ulm.twiddern.de
www.bautzen.twiddern.de
www.pulsnitz.twiddern.de


Landmatrosen - freies Firmen & Freelancer Netzwerk
www.Landmatrosen.de
www.twitter.com/landmatrosen


Re: [twitter-dev] BlackBerry, XAuth and twitterapime

2010-08-06 Thread Ernandes Jr.
BB is powered by Java ME and some specific RIM Java APIs.

On Fri, Aug 6, 2010 at 8:26 AM, David Francisco Tavárez <
davidftava...@gmail.com> wrote:

> Twitter4J do not run on BB.
>
> 2010/8/6, Bess :
> > I am able to use Twitter4J Oauth in Android SDK 2.1. Can you do the
> > same on BB?
> >
> > Does BB has the same JAVA environment similar to Android? I assume
> > J2SE is very different than Android Java?
> >
> > On Aug 5, 4:52 pm, BBTweet Media Player 
> > wrote:
> >> Ernandes,
> >>
> >> Thanks for the response.  I am sure there is something small I am
> >> doing wrong.  I did grab twitter4j and made a simple j2se app to make
> >> sure I could use my consumer key and secret and XAuth worked.  So I
> >> know my account is good at least.  I am now trying to hand code the
> >> example onhttp://dev.twitter.com/pages/xauthto make sure I can
> >> properly encode a header. Everything worked fine using BASIC.  I do
> >> not see why they had to make it so hard.
> >>
> >> I am using the BB 5 and 6 OSs.
> >>
> >> On Aug 5, 2:39 pm, "Ernandes Jr."  wrote:
> >>
> >> > I do not have a BB to test the API. However, I have received some
> >> > e-mails
> >> > from people facing same problem as you. Some of them were making some
> >> > small
> >> > mistakes and then it worked, however, others did not have much
> success.
> >> > At
> >> > this moment, I am trying to find the route cause of many problems with
> >> > BB. I
> >> > hope to find it soon and then release a fix for release 1.4.
> >>
> >> > By the way. which is your BB's OS version?
> >>
> >> > Regards,
> >> > Ernandes
> >>
> >> > On Thu, Aug 5, 2010 at 4:56 AM, Bess  wrote:
> >> > > Which OAuth library did you use on your BB? Did you use the Java
> >> > > library?
> >>
> >> > > On Aug 4, 7:42 am, "Ernandes Jr."  wrote:
> >> > > > Hi,
> >>
> >> > > > I suggest you to get in touch to Twitter API ME support before
> >> > > > replacing
> >> > > > codes. Send an e-mail to supp...@twapime.com or check project's
> >> > > > forum
> >> > > page:http://kenai.com/projects/twitterapime/forums/forum
> >>
> >> > > > Maybe your issues are already discussed there.
> >>
> >> > > > Regards,
> >> > > > Ernandes
> >>
> >> > > > On Tue, Aug 3, 2010 at 9:21 PM, BBTweet Media Player <
> >> > > bbtweetme...@gmail.com
> >>
> >> > > > > wrote:
> >> > > > > I am having a very difficult time trying to get XAuth working in
> >> > > > > my
> >> > > > > BlackBerry app.  I have downloaded twitterapime the hmacsha
> >> > > > > ecodingand
> >> > > > > Base64Ecoder did not seem to work for me so I replaced the
> >> > > > > getSignature method in XAuthSigner with...
> >>
> >> > > > > /**
> >> > > > > * 
> >> > > > > * Generate a signature from the given base string.
> >> > > > > * 
> >> > > > > * @param baseString Base string.
> >> > > > > * @param consumerSecret Consumer secret.
> >> > > > > * @param tokenSecret Token secret.
> >> > > > > * @return Signature.
> >> > > > > */
> >> > > > >private static String getSignature(String baseString,
> >> > > > > String
> >> > > > > consumerSecret,
> >> > > > >String tokenSecret) {
> >> > > > > //  byte[] b = HMAC.getHmac(baseString,
> consumerSecret
> >> > > > > +
> >> > > '&' +
> >> > > > > tokenSecret);
> >> > > > > //  //
> >> > > > > //  return Base64Encoder.encode(b);
> >> > > > >String ret = null;
> >> > > > >try {
> >> > > > >ret = hmacsha1(baseString, consumerSecret
> +
> >> > > > > '&'
> >> > > +
> >> > > > > tokenSecret);
> >> > > > >} catch (Exception e) {
> >> > > > >new RuntimeException(e.getMessage());
> >> > > > >}
> >> > > > >return ret;
> >> > > > >}
> >>
> >> > > > >private static String hmacsha1(String key, String
> message)
> >> > > > >throws CryptoTokenException,
> >> > > CryptoUnsupportedOperationException,
> >> > > > > IOException {
> >> > > > >  HMACKey k = new HMACKey(key.getBytes());
> >> > > > >  HMAC hmac = new HMAC(k, new SHA1Digest());
> >> > > > >  hmac.update(message.getBytes());
> >> > > > >  byte[] mac = hmac.getMAC();
> >> > > > >  return Base64OutputStream.encodeAsString(mac, 0,
> >> > > > > mac.length, false, false);
> >> > > > >}
> >>
> >> > > > > and any  base 64 encodings with
> >> > > > > Base64OutputStream.encodeAsString(mac,
> >> > > > > 0, mac.length, false, false);
> >>
> >> > > > > I get 401 errors when attempting to get my request token.
> >>
> >> > > > > I can replace my secrets, ids and pass with dummys and place a
> >> > > > > step by
> >> > > > > steps of what is going on if that would help?
> >>
> >> > > > --
> >> > > > Ernandes Jr.
> >> > > > -
> >> > > > "ALL programs are poems. However,
> >> > > > NOT all programmers are poets."
> >>
> >> > --
> >> > 

Re: [twitter-dev] Re: DMs and followers list

2010-08-06 Thread Matt Harris
Hi Mark,

In the Twitter direct message composition screen we display an alphabetised
list of up to 100 of the most recent users you sent direct messages to.

Hope that helps,
Matt

On Wed, Aug 4, 2010 at 12:38 PM, Mark Krieger wrote:

> Thanks, one of my colleagues, who is more ajax-savvy than me,
> suggested similar just a few
> minutes ago.
>
> I appreciate your advice. We will do this, but I probably not top
> priority.
>
> I still wonder what twitter does, since someone I know who does have
> many followers could not
> explain what twitter does with his DM followers dropdown
>
> Thanks again,
>
> Mark
>
> On Aug 4, 11:40 am, Marcelo Calbucci  wrote:
> > Mark, you should implement similarly to what Google Auto-suggest does...
> As
> > users start typing they send AJAX calls back to the servers that return
> the
> > top 10 matches. As long as your server responds quickly, users are not
> going
> > to notice because the total latency might be 100 or 200ms, which would
> > enough to keep users happy.
> >
> > -Marcelo
> >
> > On Wed, Aug 4, 2010 at 6:32 AM, Mark Krieger 
> wrote:
> > > I am working on a twitter application, I want followers to be kept in
> > > a dropdown in my application like twitter does when I send a DM from
> > > twitter. However, since I have less than 50 followers now (alas), I do
> > > not know the twitter behavior when someone has (let's say) 5000 or
> > > 1 or even 10 followers. Surely you do not put a gigantic list
> > > into that dropdown. But since I cannot test that situation, can
> > > someone tell me what twitter itself does? I'd like to more or less do
> > > the same as twitter in this case.
> >
> > > thanks,
> >
> > > Mark
> >
> > --
> > -Marcelo
> >
> > Twitter: @calbucci  | blog.calbucci.com |
> Seattle
> > 2.0 
>



-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


[twitter-dev] Re: How is this a solution?

2010-08-06 Thread briandunnington
Taylor -

thanks for the response. it is good to hear it from the horse's mouth.

unfortunately, distributing the app without keys/secrets and asking
each user to register their own set of keys is not feasible for my
app. in lieu of a better solution, i will have to remove Twitter
integration for the time being. i look forward to the day when a
better solution is in place and i can re-enable the functionality.

ps: out of curiosity, how are apps like Spaz planning on handling this
situation? i would love to hear any creative ideas.



On Aug 5, 4:41 pm, Taylor Singletary 
wrote:
> Hi Everyone,
>
> The key exchange "solution" will not be ready for the cut
> off, unfortunately.
>
> If you want to distribute an open source application or library, it should
> either:
>   - consume only public resources not requiring authentication
>   - be distributed without consumer keys and secrets.
>
> If your API key has been afforded any kind of privileges, such as xAuth, we
> ask that you be especially vigilant in not exposing your application secrets
> in easily accesible ways. I hope the logic in that is self-evident.
>
> We know this isn't ideal. This will be easier some day -- we want it to be,
> open source developers & consumers *need* it to be, and the push for a more
> "frictionless" user experience across platform products demand it to be so.
>
> But we're supporting OAuth 1.0a right now, and for the safety of our users,
> for the ecosystem, and for you: please don't distribute API tokens and
> secrets in your open source projects.
>
> Taylor Singletaryhttp://twitter.com/episod
>
> On Thu, Aug 5, 2010 at 1:34 PM, briandunnington
> wrote:
>
> > i have seen it stated a few times that this solution is still being
> > evaluated and it sounds like it might not see the light of day (which
> > is fine by me - it seemed kind of convoluted to begin with).
>
> > however, the oAuth deadline is fast approaching - what options do open
> > source apps have in order to make the switch in time? requests to
> > @twitterapi have gone unanswered and there have been no further
> > updates as to how to proceed.  i will implement whatever alternative
> > is offered, but since the key exchange is not publicly available and
> > may never be, what is the recommended approach for keeping the
> > consumer secret a secret?
>
> > On Jul 19, 7:21 am, Taylor Singletary 
> > wrote:
> > > We're continuing to experiment with the feasibility of this feature, and
> > SSL
> > > support is one gating factor among a few others. There are future
> > solutions
> > > that we can envision that would obviate the need for this
> > less-than-friendly
> > > model.
>
> > > Taylor
>
> > > On Sat, Jul 17, 2010 at 12:35 PM, Abraham Williams <4bra...@gmail.com
> > >wrote:
>
> > > > There is an open issue for SSL support on dev.twitter.com -
> > > >http://code.google.com/p/twitter-api/issues/detail?id=1665
>
> > > > Abraham
> > > > -
> > > > Abraham Williams | Hacker Advocate |http://abrah.am
> > > > @abraham |http://projects.abrah.am|http://blog.abrah.am
> > > > This email is: [ ] shareable [x] ask first [ ] private.
>
> > > > On Fri, Jul 16, 2010 at 06:41, Decklin Foster  > >wrote:
>
> > > >> Excerpts from Cameron Kaiser's message of Fri Jul 16 01:00:55 -0400
> > 2010:
> > > >> > Actually, no. The process creates a completely new app key and
> > secret
> > > >> > cloned from the original one. They do not have anything in common
> > with
> > > >> > each other apart from the name and branding (and the user can change
> > it
> > > >> > later; it's just a regular old app key). You can see this in action
> > by
> > > >> > looking at TTYtter, which uses the process. They are not the same
> > key
> > > >> > and secret at all.
>
> > > >> When was this process turned on? (I just checked out TTYtter and
> > > >> indeed, it works.) I asked for an update a couple weeks ago but I
> > > >> hadn't seen anything here or on the announce list, so I assumed other
> > > >> things had taken priority.
>
> > > >> --
> > > >> things change.
> > > >> deck...@red-bean.com
>
>


[twitter-dev] OAuth authorizing multiple accounts and disabling automatic redirection when account is already authorized

2010-08-06 Thread Nick Spacek
That's a long subject line, but I haven't seen much related to it
(there was one post last Autumn but didn't seem to have any
resolutions.

I'm working on an app where an app user may want to authorize multiple
Twitter accounts. Right now if they are already logged into Twitter
(say, with their primary account) and the account is already
authorized, they don't even get the option to sign in to a different
account; the OAuth flow just redirects the browser immediately to the
callback URL. Is there any way around this?

Is there some way to pass a username on the GET or in the headers?

Thanks,
Nick


[twitter-dev] Get resolved URLs?

2010-08-06 Thread Brian Medendorp
I can see that twitter itself must be resolving any shortened URLs
somewhere, because if you search for a domain name (such as
amazon.com), you get a bunch of results that don't seem to match until
you resolve the shortened URL in the tweet and see that it points to
the domain you searched for, which is fantastic!

However, I am wondering if there is any way to get those resolved URLs
from the API, or (better yet) if there is anyway that those URLs could
be exposed in the search results themselves. Currently, I am resolving
the URLs myself by requesting the URL and saving the resulting
location, but that starts to take a while when there are a lot of
results returned.


Re: [twitter-dev] Help with an application.

2010-08-06 Thread Matt Harris
Hi Victoria,

So we can help you out could you share the code you are using to post a
Tweet. Also, when a Tweet doesn't post you should be getting a response of
some kind from the API - can you share the responses for those failed
request too.

Best,
Matt

On Thu, Aug 5, 2010 at 12:56 PM, Victoria P <115amari...@gmail.com> wrote:

> Hi!
> My name is Victoria and I am making a twitter application that sends
> tweets to the user´s twitter account according to the actions the user
> does on the application webpage. For example if the user pushes a
> botton that says "hello", the application sends a tweet that says
> "hello" concatenated to a 5 digit random number (to avoid two tweets
> with the same message which I know Twitter doesn´t take).
>
> The problem is the application sends the tweets some of the times but
> not all of them... For example if the application is suppose to send 5
> tweets, only 3 of them gets send, or sometimes 4.
>
> I believe it has nothing to do with the variable where I put the tweet
> message (it´s a session variable concatenated with a string and the
> random number).
>
> I will appreciate your help, thanks,
>
> Victoria P.
>



-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


Re: [twitter-dev] AS3 Support?

2010-08-06 Thread Matt Harris
Hi Dave,

There is a community written AS3 OAuth library to help connect to the
Twitter API listed on our OAuth Libraries page:
  http://dev.twitter.com/pages/oauth_libraries#flash

There are also a number of community Twitter libraries listed on our
Libraries page:
  http://dev.twitter.com/pages/libraries#flash

Maybe a combination of those can help. If you find anymore let us know and
we'll add them to the list.

Matt

On Thu, Aug 5, 2010 at 12:29 PM, dmarr  wrote:

> Is there any kind of AS3 support for the twitter api?
>
> I am struggling trying to cobble together information on the topic and
> it seems like everything is outdated.
>
> This is the demo I am trying to implement but it doesnt seem to be
> making any requests with the connect() method:
>
>
> http://blog.yoz.sk/2010/04/twitterlogger-class-to-full-twitter-api-access-from-actionscript-3/
>
> Thanks for any help,
> Dave
>



-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


Re: [twitter-dev] Re: Will you guys help me here?

2010-08-06 Thread Matt Harris
Just to hop in on this one.

When you make a request to the Twitter API it is important you check the
HTTP code returned in the headers. When Twitter throws any 50x error (over
capacity for example) we return an HTML page. We're working on fixing this
but for the time being, if you receive a 50x response from the Twitter API
you should not try and parse the response with an XML or JSON parser.

I hope that explains what is happening in your code.

Matt

On Thu, Aug 5, 2010 at 7:31 AM, Brian Fromme  wrote:

> Omg. Its all so clear now! J'son. No, being an ass.
>
> -Original Message-
> From: Tom 
> Sent: Friday, August 06, 2010 10:23 AM
> To: Twitter Development Talk 
> Subject: [twitter-dev] Re: Will you guys help me here?
>
> On Aug 6, 11:06 am, Rushikesh Bhanage  wrote:
> > Hi guys,
> >
> >with a hope to get some sort of help here,  I wanted to ask you guys,
>  I
> > am getting error while loading xml formatted data into   object
> > like:
> >
> > *   "Warning*: simplexml_load_string()
> > [function.simplexml-load-string<
> http://www.honestfollowers.com/function.simplexml-load-string>]:
> > Entity: line 50: parser error : Entity 'rsaquo' not defined in*
> > /home/ajit/public_html/
> honestfollowers.com/TwitterAPILibrary/mytwitter1.php*on
> > line
> > *486"
> Simplexml can't handle all (any?) entities. You can try using the full
> PHP XML parser (http://php.net/xml) or write your own.
>
> > *   Line 486 on mytwitter1.php is :   $data =
> > simplexml_load_string($xml);
> > *
> >*Due to this error I am not getting whole data of a user.
> >
> > *   *Is it twitter overcapacity error? because this error comes usually
> when
> > even my twitter homepage comes in a damaged state.
> It is possible - make sure to write a few lines of code to make sure
> you have some error handling.
>
> >if this is not from twitter-side , what can be the problem(means like
> > internet speed or anything)?
> PHP can be the problem.
>
> > *
> >*I am using rest API method and My Twitter Class PHP by Andres "Artux"
> > Scheffer, Mozilla browser (v3.6.8).
> >
> >I will really appreciate your help guys.
> >
> >Thank you in advance.
> You're welcome.
>
> One more note before ending this message: You should consider using
> JSON instead of XML. It's easier to parse and requires less bandwidth.
>
> Tom
>
>


-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


RE: [twitter-dev] Re: Will you guys help me here?

2010-08-06 Thread Brian Fromme
Omg. Its all so clear now! J'son. No, being an ass. 

-Original Message-
From: Tom 
Sent: Friday, August 06, 2010 10:23 AM
To: Twitter Development Talk 
Subject: [twitter-dev] Re: Will you guys help me here?

On Aug 6, 11:06 am, Rushikesh Bhanage  wrote:
> Hi guys,
>
>    with a hope to get some sort of help here,  I wanted to ask you guys,  I
> am getting error while loading xml formatted data into       object
>     like:
>
> *   "Warning*: simplexml_load_string()
> [function.simplexml-load-string]:
> Entity: line 50: parser error : Entity 'rsaquo' not defined in        *
> /home/ajit/public_html/honestfollowers.com/TwitterAPILibrary/mytwitter1.php*on
> line
> *486"
Simplexml can't handle all (any?) entities. You can try using the full
PHP XML parser (http://php.net/xml) or write your own.

> *   Line 486 on mytwitter1.php is :       $data =
> simplexml_load_string($xml);
> *
>    *Due to this error I am not getting whole data of a user.
>
> *   *Is it twitter overcapacity error? because this error comes usually when
> even my twitter homepage comes in a damaged         state.
It is possible - make sure to write a few lines of code to make sure
you have some error handling.

>    if this is not from twitter-side , what can be the problem(means like
> internet speed or anything)?
PHP can be the problem.

> *
>    *I am using rest API method and My Twitter Class PHP by Andres "Artux"
> Scheffer, Mozilla browser (v3.6.8).
>
>    I will really appreciate your help guys.
>
>    Thank you in advance.
You're welcome.

One more note before ending this message: You should consider using
JSON instead of XML. It's easier to parse and requires less bandwidth.

Tom



[twitter-dev] Re: OAuth singing on BlackBerry

2010-08-06 Thread Tom
Hi,

I don't have a java compiler ready so I can't test your code.

The page about xAuth shows all steps between the start and the actual
signature. Try reproducing every single one of these values. (Usually
you can simply log all steps and then compare the results with the
xauth page.)

Tom


On Aug 6, 2:56 am, BBTweet Media Player 
wrote:
> I am having a really tough time trying to figure out how to sign my
> OAuth request.  I am trying to follow the example 
> athttp://dev.twitter.com/pages/xauth
> and my signature does not come out the same as it does in the
> example...
>
> I am doing
>
> public static void xauth(){
>         try {
>             String twitter_url="https://api.twitter.com/oauth/
> access_token";
>             String oauth_consumer_key = "sGNxxnqgZRHUt6NunK3uw";
>             String oauth_consumer_secret =
> "5kEQypKe7lFHnufLtsocB1vAzO07xLFgp2Pc4sp2vk";
>             String oauth_nonce =
> "WLxsobj4rhS2xmCbaAeT4aAkRfx4vSHX4OnYpTE77hA";
>             String oauth_signature_method = "HMAC-SHA1";
>             String oauth_timestamp = "1276101652";
>             String oauth_version = "1.0";
>             String x_auth_mode = "client_auth";
>             String x_auth_password = "%&123!aZ+()456242134";
>             String x_auth_username = "tpFriendlyGiant";
>
>             String postBody = "x_auth_mode="+x_auth_mode
> +"&x_auth_password="+encodeUTF8(x_auth_password)+
>                 "&x_auth_username="+encodeUTF8(x_auth_username);
>
>             String baseString = "POST&"+encodeUTF8(twitter_url)+
>                 "&oauth_consumer_key%3D"+oauth_consumer_key +
>                 "%26oauth_nonce%3D"+oauth_nonce+
>                 "%26oauth_signature_method%3D"+oauth_signature_method+
>                 "%26oauth_timestamp%3D"+oauth_timestamp+
>                 "%26oauth_version%3D"+oauth_version+
>                 "%26"+encodeUTF8(postBody);
>
>             String signingSecret = encodeUTF8(oauth_consumer_secret)
> +"&";
>
>             String signature = hmacsha1(signingSecret, baseString);
>
>             String header = new StringBuffer("OAuth oauth_nonce=
> \"").append(oauth_nonce).append("\", oauth_signature_method=\"")
>                 .append(oauth_signature_method).append("\",
> oauth_timestamp=\"").append(oauth_timestamp).append("\",
> oauth_consumer_key=\"")
>                 .append(oauth_consumer_key).append("\",
> oauth_signature=\"").append(signature).append("\", oauth_version=\"")
>                 .append(oauth_version).append("\"").toString();
>
>             System.out.println("Header = " + header);
>         } catch (CryptoTokenException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         } catch (CryptoUnsupportedOperationException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         } catch (IOException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         }
>     }
>
>     private static String hmacsha1(String key, String message) throws
> CryptoTokenException,
>         CryptoUnsupportedOperationException, IOException {
>         HMACKey k = new HMACKey(key.getBytes());
>         HMAC hmac = new HMAC(k, new SHA1Digest());
>         hmac.update(message.getBytes());
>         byte[] mac = hmac.getMAC();
>         return Base64OutputStream.encodeAsString(mac, 0, mac.length,
> false, false);
>     }
>
> Everything matches the example, but when they sign they get...
>
> oauth_signature="yUDBrcMMm6ghqBEKCFKVoJPIacU%3D"
>
> and I get...
>
> MUYmiobRdoK6s0ZVqo4xQNNO17w=
>
> Can anyone see anything I am doing wrong?
>
> Thanks,
> Kevin


[twitter-dev] Re: POST :user/lists

2010-08-06 Thread Tom
I have no idea why :user is used, although I can imagine that it has
something to do with accounts that are managed by multiple people
(contributors) or something. To be honest, I have no idea at all.

To answer your question about the best source of API documentation:
dev.twitter.com, and if you can't find it there, Google. Of course,
you can always ask it on this list.

Tom


On Aug 6, 10:58 am, Ken  wrote:
> I'd like some help as I implement and test the API methods, of which
> there are dozens.
>
> For example, the "create list" method, titled "POST :user/lists" on
> dev.twitter.com, shows the URL endpoint 
> as:http://api.twitter.com/version/:user/lists.format
>
> I am not familiar with the notation ":user" but from the example I
> guess that means we need to insert the screen_name or id here. We
> don't keep screen name, only ids, so I wondered if that would work. By
> mistake I used a user id that was not the same as the authenticated
> user. Result was, the authenticated user got a new list. The user
> whose id was sent in the URL was unaffected. Then i tried sending one
> with some junk in place of the user and got this error:
>
> 
> 
>   /1/jdsflfj/lists.xml
>   Not found
> 
>
> Why are we sending :user ?
>
> I guess my question is, in order to economize on time, what is the
> best source of API documentation?


[twitter-dev] Re: Will you guys help me here?

2010-08-06 Thread Tom
On Aug 6, 11:06 am, Rushikesh Bhanage  wrote:
> Hi guys,
>
>    with a hope to get some sort of help here,  I wanted to ask you guys,  I
> am getting error while loading xml formatted data into       object
>     like:
>
> *   "Warning*: simplexml_load_string()
> [function.simplexml-load-string]:
> Entity: line 50: parser error : Entity 'rsaquo' not defined in        *
> /home/ajit/public_html/honestfollowers.com/TwitterAPILibrary/mytwitter1.php*on
> line
> *486"
Simplexml can't handle all (any?) entities. You can try using the full
PHP XML parser (http://php.net/xml) or write your own.

> *   Line 486 on mytwitter1.php is :       $data =
> simplexml_load_string($xml);
> *
>    *Due to this error I am not getting whole data of a user.
>
> *   *Is it twitter overcapacity error? because this error comes usually when
> even my twitter homepage comes in a damaged         state.
It is possible - make sure to write a few lines of code to make sure
you have some error handling.

>    if this is not from twitter-side , what can be the problem(means like
> internet speed or anything)?
PHP can be the problem.

> *
>    *I am using rest API method and My Twitter Class PHP by Andres "Artux"
> Scheffer, Mozilla browser (v3.6.8).
>
>    I will really appreciate your help guys.
>
>    Thank you in advance.
You're welcome.

One more note before ending this message: You should consider using
JSON instead of XML. It's easier to parse and requires less bandwidth.

Tom


[twitter-dev] Re: I ask to debug [0] => array and list => Array

2010-08-06 Thread Tom
Sorry, but I have no idea what you are talking about.

Please answer these questions :
1. What are you trying to achieve?
2. What is the Twitter data (json/xml) you get?
3. What is the actual problem?

Tom


On Aug 6, 3:15 pm, twiDDern  wrote:
> Hello
> sorry for the bad english!
>
> I ask to debug a [0] and array and list => Array
> variable it shows me that I can not interpret correctly.
> can someone give me a hint.
> what are these variables?
>
> what is:
>
> 1st [following] >>> ([following] is not [friends_count]
> 2nd [show_all_inline_media]
> 3rd [follow_request_sent]>>>??
> 4th [notifications] shows me when I get new DM?
> 5th [geo] is the geotag? e.g. mobile phone?
> 6th [coordinates], or is it the geotags?
>
> sorry, it might ask beginners, but for me a bit confusing.
> thanks for your help


[twitter-dev] Re: how to send my consumer key and consumer secrect from hearder

2010-08-06 Thread Tom
Hi,

The best option for starting developers is to use a Twitter library,
which you can find at http://dev.twitter.com/pages/oauth_libraries

The setup procedure depends on the library.

Tom

PS: I hope that your programming code has less typo's than your
messages ;-)



On Aug 6, 8:14 am, chinna  wrote:
> i am integrating twitter with my web application . I have registered
> my application with twitte and got the  Consumer key and  Consumer
> secret.Now how to send my consumer key and consumer secrect from
> hearder from my application to get the login page from twitter.
> thanks in advance


[twitter-dev] Re: Posting Comments using OAuth in C#.NET

2010-08-06 Thread Tom
There are several .NET libraries here :
http://dev.twitter.com/pages/oauth_libraries

Tom


On Aug 6, 11:25 am, Siva Shunmugam  wrote:
> Hi Guys,
>
> can you give me some sample code which posts the comments to the
> twitter using OAuth.
>
> Thanx.
> Siva


[twitter-dev] Re: Good morning

2010-08-06 Thread Tom
I'm sure that there are people here who can teach you all kinds of
stuff, but they would all direct you to the documentation eventually.
Keep reading, and if you have questions, just ask them here. ;-)

Tom


On Aug 5, 1:07 pm, Brian Fromme  wrote:
> I am having a hard time reading it all. Is there someone to teach me what to 
> do next?


[twitter-dev] Re: Remote Server Error : 403 Forbidden

2010-08-06 Thread Tom
Well, 1 thing I notice is that you are using Basic Authentication.
Don't!

Also, I don't see what you are sending - I only see code. Can you show
an example request?

Tom


On Aug 6, 11:22 am, Siva Shunmugam  wrote:
> Hi Guys,
>
> I have created a code which posts the comments to the twitter.. but
> the code was posting only for the first time... and from the next time
> itz throwing Remote Server Error : 403 Forbidden error. I am
> experiencing this issue only for the past two day.. previously it was
> working properly..
>
> Let me know your feedback..
>
> Here is my code which I have used
>
>     HttpWebRequest request = null;
>             WebResponse webResponse = null;
>             Stream reqStream = null;
>
>             try
>             {
>
>                 XmlDocument result = new XmlDocument();
>                 string user =
> Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(username +
> ":" + password));
>
>                 byte[] bytes =
> System.Text.Encoding.ASCII.GetBytes("status=" + description);
>                 request = (HttpWebRequest)WebRequest.Create(@"http://
> twitter.com/statuses/update.xml");
>                 request.Method = "POST";
>                 request.ServicePoint.Expect100Continue = false;
>                 request.Headers.Add("Authorization", "Basic " + user);
>                 request.ContentType = "application/x-www-form-
> urlencoded";
>                 request.ContentLength = bytes.Length;
>
>                 reqStream = request.GetRequestStream();
>                 reqStream.Write(bytes, 0, bytes.Length);
>                 reqStream.Close();
>
>                 webResponse = request.GetResponse();
>                 using (StreamReader sr = new
> StreamReader(webResponse.GetResponseStream()))
>                 {
>                     result.Load(sr.BaseStream);
>                     sr.Close();
>                 }
>
> Thanx..
> Siva


[twitter-dev] OAuth request token 401 error

2010-08-06 Thread ladyvoltron
Hi,

I 've recently successfully implemented OAuth for Hyves and now trying
to get OAuth working for Twitter. As it was recommended in Twitter API
documentation, I used POST with 'Authorization' header. I keep getting
401 Unauthorized status with message 'Failed to validate oauth
signature and token'. I tried using GET instead of POST and looked a
lot at discussion groups for useful hints, but it didn't help so far.

The signature calculation is ok, I checked it with this example:http://
dev.twitter.com/pages/auth#request-token
The system time (known OAuth issue) is also fine. I use

I use Perl v5.6.1 built for i686-linux.

Here is the base string:

POST&https%3A%2F%2Fapi.twitter.com%2Foauth
%2Frequest_token&oauth_callback%3Dhttp%3A%2F%2Ftest2.momac.net
%26oauth_consumer_key%3DZ0NYrrMpi5mjNfLiNj5mMA%26oauth_nonce
%3D10347T1281101730%26oauth_signature_method%3DHMAC-
SHA1%26oauth_timestamp%3D1281101730%26oauth_version%3D1.0

Here are the headers I send in POST request:

Authorization: OAuth oauth_callback="http%3A%2F%2Ftest2.momac.net",
oauth_consumer_key="Z0NYrrMpi5mjNfLiNj5mMA",
oauth_nonce="10347T1281101730",
oauth_signature_method="HMAC-SHA1", oauth_timestamp="1281101730",
oauth_version="1.0",
oauth_signature="wXL8IB6mV4R0Or7yCbIoqwCwr4g%3D"

Content-Type: application/x-www-form-urlencoded

Here is the response I receive from Twitter API:

'client-ssl-cert-issuer' => '/C=US/O=Equifax/OU=Equifax Secure
Certificate Authority',
'client-ssl-cipher' => 'DHE-RSA-AES256-SHA',
'pragma' => 'no-cache',
'server' => 'hi',
'vary' => 'Accept-Encoding',
'cache-control' => 'no-cache, no-store, must-revalidate, pre-check=0,
post-check=0',
'content-length' => '44',
'status' => '401 Unauthorized',
'x-runtime' => '0.01541',
'client-ssl-cert-subject' =>
'/serialNumber=Zys2dJJ09EPoEVGXYtegIdxG3OZtEOib/C=US/O=*.twitter.com/
OU=GT57932074/OU=See www.rapidssl.com/resources/cps (c)10/OU=Domain
Control Validated -
RapidSSL(R)/CN=*.twitter.com',
'date' => 'Fri, 06 Aug 2010 13:35:31 GMT',
'client-date' => 'Fri, 06 Aug 2010 13:35:31 GMT',
'expires' => 'Tue, 31 Mar 1981 05:00:00 GMT',
'content-type' => 'text/html; charset=utf-8',
'client-ssl-warning' => 'Peer certificate not verified',
'client-warning' => 'Missing Authenticate header',
'last-modified' => 'Fri, 06 Aug 2010 13:35:31 GMT',
'set-cookie' => [
 'k=80.95.167.85.1281101731661533; path=/;
expires=Fri, 13-Aug-10 13:35:31
GMT; domain=.twitter.com',
 'guest_id=128110173167052617; path=/; expires=Sun, 05
Sep 2010 13:35:31
GMT',
 
'_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCFgXnUcqAToHaWQiJTg4Z
jljNDA1MmYwZDdj
%250ANDNiZTRlYjM4NmI2YTQ4ZDljIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy
%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--
dfecf503a7f5ace8e609f3f6f08abd2ce
1fb1fdc; domain=.twitter.com; path=/'
],
'x-transaction' => '1281101731-18347-37061',
'client-peer' => '128.121.146.109:443',
'x-revision' => 'DEV',
'connection' => 'close'

Any idea what I am doing wrong?

Thanks in advance!


Re: [twitter-dev] Who to follow

2010-08-06 Thread B Fromme
i am so lost...as usual.

On Fri, Aug 6, 2010 at 9:43 AM, Taylor Singletary <
taylorsinglet...@twitter.com> wrote:

> The "Who to Follow"/"Recommended Users" API is not yet ready. We'll
> announce it here when it is though.
>
> Thanks,
> Taylor
>
>
> On Fri, Aug 6, 2010 at 2:12 AM, iLyas  wrote:
>
>> Who to follow is ready ?
>>
>
>


Re: [twitter-dev] Who to follow

2010-08-06 Thread prashant singh
yes

On Fri, Aug 6, 2010 at 2:42 PM, iLyas  wrote:

> Who to follow is ready ?




-- 
Prashant Singh
Product Manager, Spice Labs.
Blog : http://blog.spicelabs.in
"If someone's using a PC to demo the Next Big Thing... then it's not the
next big thing."~Russell Beattie


Re: [twitter-dev] Who to follow

2010-08-06 Thread Taylor Singletary
The "Who to Follow"/"Recommended Users" API is not yet ready. We'll announce
it here when it is though.

Thanks,
Taylor

On Fri, Aug 6, 2010 at 2:12 AM, iLyas  wrote:

> Who to follow is ready ?
>


[twitter-dev] Re: Twitter streaming api

2010-08-06 Thread Idoshilon
Sorry , I missed this in the API
" that follow request returns also tweets created by a specified user
and subsequently explicitly retweeted by ANY user."
It's just the tweets ..


On Aug 5, 11:07 pm, John Kalucki  wrote:
> Are you getting retweets of the specified users by other users?
>
> Please send an example query and an example tweet markup that was
> delivered, but shouldn't have been delivered.
>
> -John Kaluckihttp://twitter.com/jkalucki
> Twitter Inc.
>
>
>
> On Thu, Aug 5, 2010 at 5:03 PM, Idoshilon  wrote:
> > I'm using the Twitter Streaming api (Ror & TwitterStream) , and I'm
> > setting the client to follow a set of user accounts (using the account
> > IDs).
> > But it seems like I'm getting tweets from accounts I don't follow .
> > Did anyone ever encounter this before ?


Re: [twitter-dev] BlackBerry, XAuth and twitterapime

2010-08-06 Thread David Francisco Tavárez
Twitter4J do not run on BB.

2010/8/6, Bess :
> I am able to use Twitter4J Oauth in Android SDK 2.1. Can you do the
> same on BB?
>
> Does BB has the same JAVA environment similar to Android? I assume
> J2SE is very different than Android Java?
>
> On Aug 5, 4:52 pm, BBTweet Media Player 
> wrote:
>> Ernandes,
>>
>> Thanks for the response.  I am sure there is something small I am
>> doing wrong.  I did grab twitter4j and made a simple j2se app to make
>> sure I could use my consumer key and secret and XAuth worked.  So I
>> know my account is good at least.  I am now trying to hand code the
>> example onhttp://dev.twitter.com/pages/xauthto make sure I can
>> properly encode a header. Everything worked fine using BASIC.  I do
>> not see why they had to make it so hard.
>>
>> I am using the BB 5 and 6 OSs.
>>
>> On Aug 5, 2:39 pm, "Ernandes Jr."  wrote:
>>
>> > I do not have a BB to test the API. However, I have received some
>> > e-mails
>> > from people facing same problem as you. Some of them were making some
>> > small
>> > mistakes and then it worked, however, others did not have much success.
>> > At
>> > this moment, I am trying to find the route cause of many problems with
>> > BB. I
>> > hope to find it soon and then release a fix for release 1.4.
>>
>> > By the way. which is your BB's OS version?
>>
>> > Regards,
>> > Ernandes
>>
>> > On Thu, Aug 5, 2010 at 4:56 AM, Bess  wrote:
>> > > Which OAuth library did you use on your BB? Did you use the Java
>> > > library?
>>
>> > > On Aug 4, 7:42 am, "Ernandes Jr."  wrote:
>> > > > Hi,
>>
>> > > > I suggest you to get in touch to Twitter API ME support before
>> > > > replacing
>> > > > codes. Send an e-mail to supp...@twapime.com or check project's
>> > > > forum
>> > > page:http://kenai.com/projects/twitterapime/forums/forum
>>
>> > > > Maybe your issues are already discussed there.
>>
>> > > > Regards,
>> > > > Ernandes
>>
>> > > > On Tue, Aug 3, 2010 at 9:21 PM, BBTweet Media Player <
>> > > bbtweetme...@gmail.com
>>
>> > > > > wrote:
>> > > > > I am having a very difficult time trying to get XAuth working in
>> > > > > my
>> > > > > BlackBerry app.  I have downloaded twitterapime the hmacsha
>> > > > > ecodingand
>> > > > > Base64Ecoder did not seem to work for me so I replaced the
>> > > > > getSignature method in XAuthSigner with...
>>
>> > > > > /**
>> > > > >         * 
>> > > > >         * Generate a signature from the given base string.
>> > > > >         * 
>> > > > >         * @param baseString Base string.
>> > > > >         * @param consumerSecret Consumer secret.
>> > > > >         * @param tokenSecret Token secret.
>> > > > >         * @return Signature.
>> > > > >         */
>> > > > >        private static String getSignature(String baseString,
>> > > > > String
>> > > > > consumerSecret,
>> > > > >                String tokenSecret) {
>> > > > > //              byte[] b = HMAC.getHmac(baseString, consumerSecret
>> > > > > +
>> > > '&' +
>> > > > > tokenSecret);
>> > > > > //              //
>> > > > > //              return Base64Encoder.encode(b);
>> > > > >                String ret = null;
>> > > > >                try {
>> > > > >                        ret = hmacsha1(baseString, consumerSecret +
>> > > > > '&'
>> > > +
>> > > > > tokenSecret);
>> > > > >                } catch (Exception e) {
>> > > > >                        new RuntimeException(e.getMessage());
>> > > > >                }
>> > > > >                return ret;
>> > > > >        }
>>
>> > > > >        private static String hmacsha1(String key, String message)
>> > > > >        throws CryptoTokenException,
>> > > CryptoUnsupportedOperationException,
>> > > > > IOException {
>> > > > >              HMACKey k = new HMACKey(key.getBytes());
>> > > > >              HMAC hmac = new HMAC(k, new SHA1Digest());
>> > > > >              hmac.update(message.getBytes());
>> > > > >              byte[] mac = hmac.getMAC();
>> > > > >              return Base64OutputStream.encodeAsString(mac, 0,
>> > > > > mac.length, false, false);
>> > > > >    }
>>
>> > > > > and any  base 64 encodings with
>> > > > > Base64OutputStream.encodeAsString(mac,
>> > > > > 0, mac.length, false, false);
>>
>> > > > > I get 401 errors when attempting to get my request token.
>>
>> > > > > I can replace my secrets, ids and pass with dummys and place a
>> > > > > step by
>> > > > > steps of what is going on if that would help?
>>
>> > > > --
>> > > > Ernandes Jr.
>> > > > -
>> > > > "ALL programs are poems. However,
>> > > > NOT all programmers are poets."
>>
>> > --
>> > Ernandes Jr.
>> > -
>> > "ALL programs are poems. However,
>> > NOT all programmers are poets."

-- 
Enviado desde mi dispositivo móvil

David F. Tavárez

Software Developer
http://www.davidtavarez.com/
http://twitter.com/davidtavarez
http://www.facebook.com/davidtavarez


[twitter-dev] Good morning

2010-08-06 Thread Brian Fromme
I am having a hard time reading it all. Is there someone to teach me what to do 
next?

[twitter-dev] Remote Server Error : 403 Forbidden

2010-08-06 Thread Siva Shunmugam
Hi Guys,

I have created a code which posts the comments to the twitter.. but
the code was posting only for the first time... and from the next time
itz throwing Remote Server Error : 403 Forbidden error. I am
experiencing this issue only for the past two day.. previously it was
working properly..

Let me know your feedback..

Here is my code which I have used

HttpWebRequest request = null;
WebResponse webResponse = null;
Stream reqStream = null;

try
{

XmlDocument result = new XmlDocument();
string user =
Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(username +
":" + password));

byte[] bytes =
System.Text.Encoding.ASCII.GetBytes("status=" + description);
request = (HttpWebRequest)WebRequest.Create(@"http://
twitter.com/statuses/update.xml");
request.Method = "POST";
request.ServicePoint.Expect100Continue = false;
request.Headers.Add("Authorization", "Basic " + user);
request.ContentType = "application/x-www-form-
urlencoded";
request.ContentLength = bytes.Length;


reqStream = request.GetRequestStream();
reqStream.Write(bytes, 0, bytes.Length);
reqStream.Close();

webResponse = request.GetResponse();
using (StreamReader sr = new
StreamReader(webResponse.GetResponseStream()))
{
result.Load(sr.BaseStream);
sr.Close();
}

Thanx..
Siva


[twitter-dev] Posting Comments using OAuth in C#.NET

2010-08-06 Thread Siva Shunmugam
Hi Guys,

can you give me some sample code which posts the comments to the
twitter using OAuth.

Thanx.
Siva


[twitter-dev] Who to follow

2010-08-06 Thread iLyas
Who to follow is ready ?


[twitter-dev] how to send my consumer key and consumer secrect from hearder

2010-08-06 Thread chinna
i am integrating twitter with my web application . I have registered
my application with twitte and got the  Consumer key and  Consumer
secret.Now how to send my consumer key and consumer secrect from
hearder from my application to get the login page from twitter.
thanks in advance


[twitter-dev] I ask to debug [0] => array and list => Array

2010-08-06 Thread twiDDern
Hello
sorry for the bad english!

I ask to debug a [0] and array and list => Array
variable it shows me that I can not interpret correctly.
can someone give me a hint.
what are these variables?

what is:

1st [following] >>> ([following] is not [friends_count]
2nd [show_all_inline_media]
3rd [follow_request_sent]>>>??
4th [notifications] shows me when I get new DM?
5th [geo] is the geotag? e.g. mobile phone?
6th [coordinates], or is it the geotags?


sorry, it might ask beginners, but for me a bit confusing.
thanks for your help


[twitter-dev] Re: BlackBerry, XAuth and twitterapime

2010-08-06 Thread Bess
I am able to use Twitter4J Oauth in Android SDK 2.1. Can you do the
same on BB?

Does BB has the same JAVA environment similar to Android? I assume
J2SE is very different than Android Java?

On Aug 5, 4:52 pm, BBTweet Media Player 
wrote:
> Ernandes,
>
> Thanks for the response.  I am sure there is something small I am
> doing wrong.  I did grab twitter4j and made a simple j2se app to make
> sure I could use my consumer key and secret and XAuth worked.  So I
> know my account is good at least.  I am now trying to hand code the
> example onhttp://dev.twitter.com/pages/xauthto make sure I can
> properly encode a header. Everything worked fine using BASIC.  I do
> not see why they had to make it so hard.
>
> I am using the BB 5 and 6 OSs.
>
> On Aug 5, 2:39 pm, "Ernandes Jr."  wrote:
>
> > I do not have a BB to test the API. However, I have received some e-mails
> > from people facing same problem as you. Some of them were making some small
> > mistakes and then it worked, however, others did not have much success. At
> > this moment, I am trying to find the route cause of many problems with BB. I
> > hope to find it soon and then release a fix for release 1.4.
>
> > By the way. which is your BB's OS version?
>
> > Regards,
> > Ernandes
>
> > On Thu, Aug 5, 2010 at 4:56 AM, Bess  wrote:
> > > Which OAuth library did you use on your BB? Did you use the Java
> > > library?
>
> > > On Aug 4, 7:42 am, "Ernandes Jr."  wrote:
> > > > Hi,
>
> > > > I suggest you to get in touch to Twitter API ME support before replacing
> > > > codes. Send an e-mail to supp...@twapime.com or check project's forum
> > > page:http://kenai.com/projects/twitterapime/forums/forum
>
> > > > Maybe your issues are already discussed there.
>
> > > > Regards,
> > > > Ernandes
>
> > > > On Tue, Aug 3, 2010 at 9:21 PM, BBTweet Media Player <
> > > bbtweetme...@gmail.com
>
> > > > > wrote:
> > > > > I am having a very difficult time trying to get XAuth working in my
> > > > > BlackBerry app.  I have downloaded twitterapime the hmacsha ecodingand
> > > > > Base64Ecoder did not seem to work for me so I replaced the
> > > > > getSignature method in XAuthSigner with...
>
> > > > > /**
> > > > >         * 
> > > > >         * Generate a signature from the given base string.
> > > > >         * 
> > > > >         * @param baseString Base string.
> > > > >         * @param consumerSecret Consumer secret.
> > > > >         * @param tokenSecret Token secret.
> > > > >         * @return Signature.
> > > > >         */
> > > > >        private static String getSignature(String baseString, String
> > > > > consumerSecret,
> > > > >                String tokenSecret) {
> > > > > //              byte[] b = HMAC.getHmac(baseString, consumerSecret +
> > > '&' +
> > > > > tokenSecret);
> > > > > //              //
> > > > > //              return Base64Encoder.encode(b);
> > > > >                String ret = null;
> > > > >                try {
> > > > >                        ret = hmacsha1(baseString, consumerSecret + '&'
> > > +
> > > > > tokenSecret);
> > > > >                } catch (Exception e) {
> > > > >                        new RuntimeException(e.getMessage());
> > > > >                }
> > > > >                return ret;
> > > > >        }
>
> > > > >        private static String hmacsha1(String key, String message)
> > > > >        throws CryptoTokenException,
> > > CryptoUnsupportedOperationException,
> > > > > IOException {
> > > > >              HMACKey k = new HMACKey(key.getBytes());
> > > > >              HMAC hmac = new HMAC(k, new SHA1Digest());
> > > > >              hmac.update(message.getBytes());
> > > > >              byte[] mac = hmac.getMAC();
> > > > >              return Base64OutputStream.encodeAsString(mac, 0,
> > > > > mac.length, false, false);
> > > > >    }
>
> > > > > and any  base 64 encodings with Base64OutputStream.encodeAsString(mac,
> > > > > 0, mac.length, false, false);
>
> > > > > I get 401 errors when attempting to get my request token.
>
> > > > > I can replace my secrets, ids and pass with dummys and place a step by
> > > > > steps of what is going on if that would help?
>
> > > > --
> > > > Ernandes Jr.
> > > > -
> > > > "ALL programs are poems. However,
> > > > NOT all programmers are poets."
>
> > --
> > Ernandes Jr.
> > -
> > "ALL programs are poems. However,
> > NOT all programmers are poets."


[twitter-dev] Re: Using the Authorization header

2010-08-06 Thread Ben Jones
Hi Taylor,

Thanks for the pointers! Turned out the problem was related to
encoding. I fixed the encoding on the status in the body, and
then noticed that I wasn't encoding the '=' at the end of the
signature in the header. When I'd put the signature in the body,
it was encoded with all the other parameters, so worked
correctly. Now both ways are fine.

Thanks again,
ben


On Aug 5, 3:21 pm, Taylor Singletary 
wrote:
> Hi Everyone on this thread,
>
> A few clarifications:
>
> - The "realm" isn't required, but we'll take a realm if you provide one.
> Really, it's a no-op in our system. We don't care if you have it or not, and
> if you provide it, we don't do anything with it.
>
> - Timestamp is important in that the oauth_timestamp in your requests should
> be within about 5 minutes of our servers. We return the current time in a
> header within each response, failed or otherwise. One quick way to get a
> non-rate-limited check on the current time according to twitter is to send a
> HEAD request to /1/help/test.xml and inspect the "Date" header,
> recontextualizing your app's concept of the current time based on that.
>
> Back to the original poster's issue, I noticed you're essentially trying to
> post this status:
>
> "Test 1 2 3 4 1280937572396"
>
> But your POST body shows this status over-encoded:
> "status=Test%25201%25202%25203%25204%25201280937572396"
>
> When it should be:
> "status=Test%201%202%203%204%201280937572396"
>
> The encoding in your POST body is correct as to what should be in your
> signature base string. This might be what is causing your invalid signature
> errors.
>
> Taylor
> On Thu, Aug 5, 2010 at 5:10 AM, Ben Jones 
> wrote:
>
> > Hi Tom/Jacky,
>
> > Thanks for responding!
>
> > Apologies if this is a double post, last one didn't seem to go
> > through.
>
> > I tried removing 'realm' from the Authorization header, and this
> > changed the
> > response the first time, to something like 'Couldn't authenticate you
> > using
> > OAuth', but then returned to the previous behaviour of throwing 500
> > errors.
>
> > What should I look out for with regards timestamps? I'm following the
> > advice
> > from the OAuth spec, in that they have to be in seconds, and equal or
> > greater than the last used. Do they have to sync with Twitter's clock?
>
> > Thanks again!
> > ben
>
> > On Aug 5, 12:37 am, Tom  wrote:
> > > Oops, silly me, didn't read the full post. Sorry.
>
> > > Make sure to watch for character encoding and timestamps. Especially
> > > timestamps are known to cause trouble.
>
> > > 401 errors are almost never an issue at Twitter.
>
> > > Tom
>
> > > On Aug 5, 1:34 am, Tom  wrote:
>
> > > > You are sending realm="" in your Authorization header. It doesn't
> > > > belong there. ;-)
>
> > > > Tom
>
> > > > On Aug 4, 6:19 pm, Ben Jones  wrote:
>
> > > > > Hi all,
>
> > > > > I'm currently writing my own OAuth lib for use with Twitter and have
> > > > > gotten stuck whilst using the
> > > > > Authorization HTTP header, rather than putting the OAuth parameters
> > in
> > > > > the body.
>
> > > > > An example of a request that is failing is:
>
> > > > > POST /1/statuses/update.xml HTTP/1.1
> > > > > Authorization: OAuth realm="http://api.twitter.com/1/statuses/
> > > > > update.xml",
> > > > > oauth_consumer_key="x",
> > > > > oauth_token="x",
> > > > > oauth_nonce="x",
> > > > > oauth_timestamp="1280937572",
> > > > > oauth_signature_method="HMAC-SHA1",
> > > > > oauth_version="1.0",
> > > > > oauth_signature="DLPyc3h6BcC5zbGXrUcujvZnqxk="
> > > > > User-Agent: Java/1.6.0_07
> > > > > Host: api.twitter.com
> > > > > Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> > > > > Connection: keep-alive
> > > > > Content-type: application/x-www-form-urlencoded
> > > > > Content-Length: 53
>
> > > > > status=Test%25201%25202%25203%25204%25201280937572396
>
> > > > > ...(token etc blanked out, and new lines added in)
>
> > > > > This results in the server returning a 500 error and the "Something
> > is
> > > > > technically wrong." error page.
> > > > > I've talked to another developer who doesn't experience this. I've
> > > > > tried this with the parameters
> > > > > alphabetically ordered, unordered and with and without the 'realm'
> > > > > parameter, which isn't used in thehttp://
> > dev.twitter.com/pages/authpage.
>
> > > > > I don't have the same problem (as in the 500 error) when I put the
> > > > > OAuth parameters in the request
> > > > > body, but this often fails as well with 401 'Invalid signature'
> > > > > errors. What's strange is that putting the
> > > > > OAuth parameters into the form at Hueniverse's OAuth request signing
> > > > > page (http://tinyurl.com/y9bvjyt)
> > > > > shows them, including the signature, to be correct. If I retry the
> > > > > same request, it eventually works
> > > > > (sometimes it works the first time, just not consistently), so I
> > don't
> > > > > think I'm calculating 

[twitter-dev] Will you guys help me here?

2010-08-06 Thread Rushikesh Bhanage
Hi guys,

   with a hope to get some sort of help here,  I wanted to ask you guys,  I
am getting error while loading xml formatted data into   object
like:

*   "Warning*: simplexml_load_string()
[function.simplexml-load-string]:
Entity: line 50: parser error : Entity 'rsaquo' not defined in*
/home/ajit/public_html/honestfollowers.com/TwitterAPILibrary/mytwitter1.php*on
line
*486"

*   Line 486 on mytwitter1.php is :   $data =
simplexml_load_string($xml);
*
   *Due to this error I am not getting whole data of a user.

*   *Is it twitter overcapacity error? because this error comes usually when
even my twitter homepage comes in a damaged state.

   if this is not from twitter-side , what can be the problem(means like
internet speed or anything)?
*
   *I am using rest API method and My Twitter Class PHP by Andres "Artux"
Scheffer, Mozilla browser (v3.6.8).


   I will really appreciate your help guys.

   Thank you in advance.
*

*


[twitter-dev] POST :user/lists

2010-08-06 Thread Ken
I'd like some help as I implement and test the API methods, of which
there are dozens.

For example, the "create list" method, titled "POST :user/lists" on
dev.twitter.com, shows the URL endpoint as:
http://api.twitter.com/version/:user/lists.format

I am not familiar with the notation ":user" but from the example I
guess that means we need to insert the screen_name or id here. We
don't keep screen name, only ids, so I wondered if that would work. By
mistake I used a user id that was not the same as the authenticated
user. Result was, the authenticated user got a new list. The user
whose id was sent in the URL was unaffected. Then i tried sending one
with some junk in place of the user and got this error:



  /1/jdsflfj/lists.xml
  Not found


Why are we sending :user ?

I guess my question is, in order to economize on time, what is the
best source of API documentation?