"Via MyApp" tag using Twitter4J in a Java Desktop Application - twitter

Well, the title explains my question. I'm developing an app that will be something like a Twitter client, and I can't find a way to make that when I publish a tweet in my account using the app the tweet shows "via MyApp". I'm using another Twitter account, not the one that I used to create the app (I don't know if that has something to be with all this, but could be so I'm telling you). Does anyone know if this is posible?
Thanks!

According to the field guide, your JSON object (named obj) has a field obj["source"] with the following meaning:
Utility used to post the Tweet, as an HTML-formatted string. Tweets from the Twitter website have a source value of web.
This means that "via MyApp" value is the client used to post the tweet. You can find the user that posted this tweet in the field obj["user"]["screen_name"]
References:
https://dev.twitter.com/overview/api/tweets
https://dev.twitter.com/overview/api/users

Related

Is there a way to use the "ms-outlook://" URI in iOS to open a specific email message by id?

I am attempting to create a QR code that opens a specific email message in the Outlook App for iOS.
I am specifically looking for something like:
ms-outlook://messages/view?id=1dfffe43-0d4e-4130-467e-08d5b4ee98bd
I have tried a lot of different combinations with no luck...
I am already aware of the "ms-outlook://compose" URI schema referenced here:
URL Scheme Attachment Microsoft Outlook app
I have already successfully pulled this off with trello, workfront, and zendesk. Just want to add outlook to the list.
Examples I have working with other apps:
Trello:
trello://x-callback-url/showCard?shortlink=h836Wd8k
Zendesk:
zendesk://agent/tickets/35436
Workfront:
workfront://TASK?ID=564f71b200d4b8f4a393335ed5a816c1
Any help is appreciated!

Twitter web intent not prepending # sign to `via` parameter

I am using a simple Twitter web intent (hyperlink) from a mobile-focused website that is intended to allow the visitor to compose a tweet pointing back to a page on my site. The intent is populated with various parameters, including a via parameter that holds a Twitter handle:
https://twitter.com/intent/tweet?url=...&via=MyTwitterHandle
When the link is clicked on most platforms, it opens twitter.com in the browser, and everything works as expected. The Twitter compose dialog opens with all of the information from the link prepopulated.
However, on iOS 9 devices that have Twitter installed, something's wrong. As expected with Universal Links, the native Twitter app handles the click. But when it loads, the via parameter (which holds my Twitter username) is populated without the # sign prepended. The native compose dialog looks something like this:
Because the # character is not prepended, Twitter doesn't recognize it as a username.
I've found two mentions of this problem on Twitter's developer site, but no solutions.
While contrary to the documentation for the Tweet Intent, I've tried including the # sign in the via parameter itself, but that results in ## in the very common case where the mobile web Twitter interface is used.
What other solutions do I have for a very simple Tweet intent that includes the via parameter and works across all major mobile platforms?
Not really an answer but I just tried and it seems like the problem is fixed as of 17th March 2016!

Twitter Oauth in windows phone 8 app

I need to use Twitter Oauth to login my windows phone app,
What i need exactly is
1)when the user click twitter log in button from my app, i need to show the twitter llog in page in a browser,
2)when he enters his credentials and accept the app, then i should get the user information like, name, gender, bday, what ever i can take.
That,s it, then i can close the browser and make my app active.
I just need to make the user to log in via twitter.
I referred lot of examples, that are all quit confusing and doing all the stuffs in twiiter.
I tried this example
and got this error
'TweetSharp.TwitterService' does not contain a definition fError 2 'TweetSharp.TwitterService' does not contain a definition for 'GetAccessToken' and no extension method 'GetAccessToken' accepting a first argument of type 'TweetSharp.TwitterService' could be found (are you missing a using directive or an assembly reference?)
and i tried enter link description here
failed on that too.
Can anybody help me to do the authentication via twitter for my app.
Thank you.
I tried this example and got success, I contacted the person who have posted that example and got help from him to solve the issues raised from this example.
Actually this Example works fine for twitter integration,
What you have to do is
1)Register your app in twitter, here the link for app registration,
log in and register your app.
2)Make sure you have given the Call Back URL(i forget to give that, and that makes me face lot of issues)
3)Note down the Consumer Key, Consumer Secret and Call back url(we need specify this 3 in our code)
4)Go to Settings, and set your app access to Read and Write
5)down load the above link and change the Consumer Key, Consumer Secret and Call back url as per your app, and then run the example, it will work fine.
Thank you.
If you just want to authenticate using Twitter and don't want to post anything, perhaps you can try Azure Mobile Service Authentication. You can find more information here: mobile services authentication

Link on Facebook with custom prefix/protocol (like myapp://blahblah)

I added to my iOS application option to detect and response to custom URL schemes to launch application ( http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html ).
Link is working perfectly on different sites (using href), but I'm having problem with Facebook. If I'm trying to post link (using Graph API) which looks like:
myapp://blabla
Facebook return error:
The url you supplied is invalid
And for feed with link return
link URL is not properly formatted.
I can't just post url as a message because it's not being detected as a URL and appear like text only.
Is there any way to post to Facebook wall with custom links?
Edit:
I have an idea, but I don't know if it gonna work. Putting
myapp://blabla directly into address field in mobile browser is launching application so probably accessing an webpage (like http://www.mywebpage/myapp) with only redirection to
myapp://blabla gonna work too, but is Facebook gonna accept that link?
I think your suggestion in the edit is the correct method, and should work. However applications like spotify seem to use an intersticial page which fires the "app link" with javascript, the advantage to this approach is that you can use that page to "sell" the app to users who don't have it and also provide lovely open graph tags for people who want to share it.

programmatically set comment with attachment in fb connect for iphone

Using FB Connect for iPhone. I'd like the user to be able to post a link with thumbnail to their profile. This is done using the "attachment" property on FBStreamDialog. In addition, I'd like to be able to provide a custom interface for the user to enter in a comment with the attachment. (The comment would be the message that's associated with the "userMessagePrompt" property).
However, the only way I can see to do this currently is for the user to enter in their message in the FBStreamDialog popup. Is there any way to programmatically set the comment in iOS?
I ended up solving this on the server side, as follows:
From my iPhone application, I make a POST request to a PHP script that includes the link to be posted, in addition to the user-supplied message.
The PHP script then uses the Stream.publish API to post the link to the user's profile:
http://wiki.developers.facebook.com/index.php/Stream.publish

Resources