display twitter compose tweet pages through an iframe - javascript

so i have kind of a strange problem, I am in the process of building my own tweet button which is simple enough just using a link that resembles this <a href="https://twitter.com/intent/tweet?text=YOUR-TITLE&url=YOUR-URL&via=TWITTER-HANDLE">
now this as a link works just fine even with the dumby data prvided the problem is i would really like this page to open in an iframe on my site.. but twitter and other social networks have disabled this capability I am woundering if anyone know's a way i can use some sort of iframe or other tech including I assume an oauth and api which will alow me to send write, and display a tweet that the user can send inside my sight ?
as just using this returns an empty frame
<iframe src="http://twitter.com/intent/tweet?text=YOUR-TITLE&url=YOUR-URL&via=TWITTER-HANDLE">
</iframe>
anyhelp on how or even if I can do this or even a site I can check out that allows me as a user to do this would be greatly appreciated
(just a note I dont wish to tweet on a user behalf but rather display a pre defined text's tweet that enable the user to send without leaving my site or opening a new window )

Seems like it's against their terms of service. I'm researching the same issue now and it looks like you need to setup 0Auth to get an access token and then use the API. I'll report back when I have the full answer.

Related

facebook share dialog redirecting instead of popping up?

I have a dynamically generated facebook share button link being generated in JS, here is the url of the button:
https://www.facebook.com/dialog/share?app_id=someAppId&display=popup&href=' + window.location.href;
That all works fine.
My issue is that the "display=popup" parameter in the links query string does not do as it says, instead it redirects to a sharing page when I expect it to popup.
What's more, when I submit the share, I do not get redirected back to my site.
I am new to the facebook sharing SDK and to be honest am getting quite stressed with it.
All I want is a simple share button (I made a custom styled button which is why I use a dynamically generated HREF) that doesn't mess with UX and works, surely it cannot be so complex to ask for?
So in short:
1) How do I make the share dialog popup instead of redirect?
2) If there is no way to stop it redirecting, how do I get it to redirect back once a share is submitted?
3) Is there a problem with the way I have done this?
4) What recommendations would you make if this were your project?
5) Is there simpler documentation or a tutorial series that you may know of for the facebook sharing SDK? Because the docs on the developer site are pretty unclear and hardcore in places, I find.
My issue is that the "display=popup" parameter in the links query string does not do as it says, instead it redirects to a sharing page when I expect it to popup.
You misunderstood what this parameter does.
Of course browsers don’t open a normal link as a popup, just because the URL in the href attribute might or might not contain certain parameters.
The purpose of this parameter is to tell the dialog what setting it will be shown in – and if that’s popup, then the dialog elements are rendered smaller than they would be in the full page version.
1) How do I make the share dialog popup instead of redirect?
By either opening the target URL in a popup yourself (window.open), or by using the JS SDK instead, FB.ui can be used to call the dialogs and will open a popup to do so.
2) If there is no way to stop it redirecting, how do I get it to redirect back once a share is submitted?
For the URL version it is mandatory to specify the redirect_uri parameter, to tell the dialog where to redirect back to after sharing.

Modify FB page plugin on my website

Hi Happy New Year and thanks in advance for your time..
So im using Facebook javascript SDK to display my FB page on my site. Its showing up as expected. Good.
Now I want to alter the Fb page title after it has loaded in my site. I tried getElementByClassName in javascript. But no effect(may be because of iframe?). This is the actual pic
And this is what i desire -- the fb page plug-in title has been changed.
Is it possible to achive this??
No, it is not possible.
The iframe content is from a different domain, and therefor the Same Origin Policy prevents you from accessing its content via JavaScript from your site.
Finally found a work around for the requirement. It is not possible to modify the page Pugin but -
use php sdk to initialise Facebook and
Use open graph to fetch the posts.
Now you can use this data as you like
By this method even individual posts can be tailored accordingly.
A working example is at -
http://callmenick.com/post/displaying-a-custom-facebook-page-feed

How to track on aspx page that link clicked from email

In my email inbox I got URL(http://localhost/sample.aspx) of a website when I click on this link this website open in browser.
Now I have to track on sample.aspx that this website coming from link clicked in email through JavaScript.
How can I track that.
For example using document.referrer we can track last visited website URL.
Thanks
The only mechanism you have for this would be to add a parameter to the querystring, so something like http://localhost/sample.aspx?emailClicked=true
You can then read this on the web site using JavaScript (or anything else for that matter) and track it as you see fit.
You cannot use Document.referrer. Because nothing referrered this link (in the case of outlook for example) or if it did (for example gmail, etc.) you don't know what the URL(s) of the hundreds of referrer's would be.

Facebook Feed Dialog simplified?

I'm trying to add a share button or "feed dialog" as Facebook now seem to be pushing, to posts on my website. I'm basically looking for a way to simply allow users to click the button and be sent to the share preview page to post to their timeline or a friend's timeline etc.
The problem is that I don't really need an app (or at least I don't see the need in an app) and I'd like to avoid using their deprecated sharer url method.
What are my options? Can I use the feed dialog method without creating an app? I've tried going through their documentation but it just confuses me.
I'm not fussed whether it's JavaScript that opens a popup or if it redirects to a separate page (provided a redirect url can be provided to return users to the original page on my website).
you definitely need an app for the FB.ui feed dialog, but the user does not have to be logged in. Without an app, you can either use the sharer.php in a javascript popup, or you can use a like and/or send button. Just make sure to include Open Graph metadata in your page.
https://developers.facebook.com/docs/reference/plugins/send/
Be aware that you should also use an app (id) with the like or send button.

Transfer custom text on Facebook using like button

Here's the thing.
Recently I've tried to add FB like button to some website I'm administrating and that was easy, but now I have a request I don't know how to handle.
The thing is, when you like some website, on your FB wall is posted a link (and some other stuff maybe) to that website, its by default and I know I can change that.
What I need is this, on my page I have a (html)div that is loaded dinamycally with some important data and I need to post that particular data on my FB wall.
I tried using javascript and open graph meta tags but it seems to me that these meta tags cannot be changed dinamycally.
If anyone has an idea how to do this, feedback is more than welcome.
Sincerely,
Milos
No, you technically cannot do this.
When you share a link on Facebook, Facebook servers visits the URL specified on sharing, collents META information and displays those.
However, Javascript runs after content is loaded and on browsers, and I don't think Facebook servers run javascripts before getting META information.
Therefore, even if you change Open graph meta tags dynamically, FB still uses old tags (which is set on initial page load).
You should figure out a way to set content before sending HTML to client.
I found a solution to this issue. This can be done using iframe to integrate FB like button. Piece of infrormation you need to do this can be found here.
It shows the FB like button and you can add your url in without having to mess up with meta tags

Categories