How to tweet a message containing a custom URL to Twitter? - twitter-oauth

Whenever I try to tweet a message containing a custom URL to Twitter using oAuth, the message is posted as plain text including all HTML tags
For example I want show the message as:
this is mysample tweet.
and this is my link: my web address

Twitter doesn't support rich text, it is plain text only. You especially can't set the link text for a URL. The only possibility which could come close is to use the cards feature for supported clients.

Related

Can you and how do you embed images in an email when using the Gmail API?

When creating a message and using it to create a draft or email using the Gmail API, can you have an image embedded in the body? I'm looking to have the image data actually embedded similar to how copying and pasting an image (the actual data, not the link) into a Gmail email will place the image right in the content.
Can it be done like this or do I need to upload the image to some other location and use HTML to embed the image in the email? Any pointers on how to do it?
The short answer is that you would do this the same way you would for any email service.
The long answer is that you need to create a multipart/related message, where one part is the HTML content of the email and the other part is the image. The image part contains a Content-ID header that specifies an ID for the image, and the HTML image tag references that ID in the src attribute using the format cid:ID_HERE.
An example of how to construct such an email in Python is here: https://stackoverflow.com/a/1633493
P.S. - A great way to see how emails are constructed is to look at the raw message. You can look at the raw message for a given email in Gmail by clicking the drop down arrow next to the message and selecting "Show original".

URL for compose Facebook Message (new layout)

I've use following URL to send message with prefill text.
http://www.facebook.com/messages/[user]?msg_prefill=[message]
ex. http://www.facebook.com/messages/facebook?msg_prefill=hello
But msg_prefill parameter seem to be depreciated on new Facebook Message layout.
http://mashable.com/2012/08/22/facebook-revamps-messages-to-look-more-like-email/
Does anyone know how to add prefill message for new layout?
I still can't send message with prefill text. But I've found another way to send link using Send Dialog.
https://developers.facebook.com/docs/reference/dialogs/send/
ex. 1
https://www.facebook.com/dialog/send?app_id=123050457758183&to=zuck&name=Hello&link=http://www.google.com/&redirect_uri=http://www.facebook.com/
However this may not working for some people (including me) as using some domains in "link" parameter cause error as this bug.
http://developers.facebook.com/bugs/284149695026014?browse=search_509788e98cb627971133933
ex. 2
https://www.facebook.com/dialog/send?app_id=123050457758183&name=People+Argue+Just+to+Win&link=http%3A%2F%2Fwww.facebook.com%2FCili.Pica%2Fapp_469715143040257&redirect_uri=http%3A%2F%2Fwww.example.com%2Fresponse
Also, Send Dialog links can't use on iPhone apps, Android apps and mobile version of facebook.
ex. 3
https://m.facebook.com/dialog/send?app_id=123050457758183&to=zuck&name=Hello&link=http://www.google.com/&redirect_uri=http://www.facebook.com/

How to send a Facebook page as url using the Facebook send button?

I will try to explain a bit the context for my problem.
Context:
A while ago I started working on Facebook application. One of the requirements is to be included in a Facebook page as a tab. This application will contain on a page a send button in order to be able to make it more engaging with specific people, users of the application would choose on their own. The reason behind this is because the Facebook page containing the application is related to alcohol, and "liking" the application will get more audition and potential children. Another reason for using send button rather then other similar options from Facebook (like send dialog etc.) is because in Facebook documentation was stated that send button works on mobile devices and other options don't.
Problem:
My problem is related to the send button. What I need is to be able to completely configure the send button: url, image, title, description. I have research the open graph tags in order to be able to do this. Everything works fine if the page I want to be sent with the message is a website OUTSIDE Facebook. Once I started to use the url of a Facebook page (let's call it www.facebook.com/mycustompage), then the crawler takes the images, title, description from facebook.com ignoring the actual page and the produced message is not what I want.
I have searched a lot to better understand this limitation and could not find anything relevant.
The only article I could find as a potential solution was (and even this I had trouble finding):
Send button returning error codes, like button works fine
The above discussion is a workaround which I have already put in place but is not 100% what I want. The described workaround is about putting in the send button:
<div class="fb-send" data-href="http://www.mycustomdomain.com/og"></div>
a page that sniffs the user agent. In case the user agent is Facebook crawler to serve an html empty page just with the open graph tags, otherwise redirect to the desired URL - which in our case is the facebook page www.facebook.com/mycustompage.
The message produced contains:
the title which is a link to www.mycustomdomain.com/og which when
clicked opens a page in a new tab with the address
www.facebook.com/mycustompage - this is relatively ok
under the title I have a "sub-title" readonly text containing the domain of the link: www.mycustomdomain.com - THIS IS NOT OK since I don't want to share where I have hosted the application.
the image and the desired description - this is ok.
Conclusion:
What I want to know if there is a better way to do this rather than this workaround.
If not I would like to know how I can hide for the produced message the "sub-title" so that the hosted domain is not visible.

How to set image, description and title for like, comment, send in cakephp facebook plugin?

I’m using webtechnick cakephp facebook plugin. I want to set image description and title for like send and comments. There are many like and send in one page. Current site get same title(what in the title tag in the html ) . i want to set different titles and descriptions for each like and send.
i want to set different titles and descriptions for each like and send.
Then have them point to different URLs, and set up a HTML page under each of those that contains the appropriate OG meta tags.

Is there a replacement for the old facebook prompt_feed.php?

I used to be able to construct a link like this:
http://www.facebook.com/connect/prompt_feed.php?message=hello
It would go to the page it currently does (click on the link to see) but it used to pre-populate the text field with the value of the message parameter. Now the text field is empty.
I suppose facebook changed this functionality, but is there a replacement that provides the same functionality? Note that I do not want to have to authenticate the user or connect them to an app. I am looking for a simple url that will just open a new window with a status message pre-populated so the user can just click "Share" (exactly how this prompt_feed.php used to work). Anybody know of a way to do this?
What about the feed dialog?
See here: https://developers.facebook.com/docs/reference/dialogs/feed/
Update: Ok, now I see that the user must have already authorized the app : [
Update 2: This isn't either a full replacement but an alternative - you could use the sharer php
http://www.facebook.com/sharer.php?u=yoursite.com&t=yourtitle
In that case yoursite.com should contain og meta tags. It does not prefill the message though : [