Is it possible to add some code that will tweet a message (or would offer to post a tweet) once a user submit a form yo post a message on my site.
Do I need to point it to my tweet account? Just trying the process.
I use PHP and jQuery on my site.
Yes it is possible. Yes, you do need to point it to some twitter account in your control (you could create a new one for your app/website).
See the twitter php libs.
Related
So I am trying to figure out if I can create a simple custom PHP script that takes data from a google hangout link and displays back if it is in session.
I am pretty new to Google APi's. My end goal is to create a button on a website that appears whenever someone has joined into a certain designated HANGOUT link.
Do you think this is possible? Any advice would be highly appreciated.
Here was I was thinking:
$stuff = strip_tags(file_get_contents("https://hangouts.google.com/hangouts/_/4im2yhs5kry4vjhlu4yop25tsea"));
$eStrings = explode(' ', $stuff);
I would then retrieve the data from the code and see if it is live or not. If at top of the screen it reads: "You are the only one here" then it is automatically assumed that the session has not begun.
Problem=> You get directed to the google login screen because you need user access.
If anyone has ideas please advise.
While there is a PHP API SDK for Google in beta, it doesn't appear to support Hangouts at all. Google does however expose a client-side JavaScript interface for Hangouts that you should be able to emit and use from your PHP server-side code.
Using the JS interface, you could use the gapi.hangout.onParticipantsChanged event notification for a given Hangout to know when someone has joined.
Then leverage the gapi.hangouts.getParticipants() function to pull a list of who's in the hangout and determine if your button should show for the current user.
Can Any one please help me. I want this textbox to be visible on my website and the users can update their status directly from the website. Thankyou in advance
The facebook API don't provide such functionality.
You may make the similar looking text box of our own, and use feed to update their status.
Sample Code.
First you need to Create a new App for your Site https://developers.facebook.com/apps
Then after creating the App,by using the API Key and App Secret with the Help of OAuth Protocol you need to Integrate as shown in their following
https://developers.facebook.com/docs/reference/php/
Then Include these two files then you give action to the Post Button.
I have a very simple form, consisting of a textarea and a submit button.
Is it possible to send the text as a tweet when someone pushes the button, if the user is already logged into twitter on another tab ?
I want to try a very simple mockup for something, I just need to send a tweet, do I still need to mess with oAuth ?
No, it's not possible. It would be quite a security issue if any website could just send tweets with your account without authorization.
You've to register an application with Twitter API, Then make Authentication for the user.
After that you can post tweets or whatever your permissions allow.
Posting tweets without Authentication is very dangerous and can be considered as malware.
You can use some ready-to-use libraries to help you with the oAuth, instead of re-inventing the wheel.
Not sure if this has been done before, but did some searching and could not find anything.
I would like to have an input box on my webpage, which has some pre-populated text and when a user clicks submit the text is tweeted on their own wall, this would be posted immediately if they have a twitter session open if not twitter will ask for the user to sign in. I guess this must be possible because it is similar to a share button.
Not being very good with twitter I'm not sure where to even start.
(Also if possible I would like to do the same but with Facebook as well).
Nb. App is to be developed using php.
Thanks
Both twitter and facebook have well-documented API to do this. However, you will probably need to use their system to have the user confirm what is about to be posted. You might also need to use some javascript, I don't the specifics of these API.
https://dev.twitter.com/
https://developers.facebook.com/
You cannot do this on facebook. We do not allow pre-filling of the message param on dialogs.
Is there a quick & easy way to setup an application to allow a user to use it if they tweet about you? Maybe click a button, it auto tweets and they can move forward in the application. Is there an application that makes this KISS simple, or do I have to start logging through the twitter API?
Use Case:
User Logs onto website & inputs email.
Popup: Tweet about us to use the application for free.
User tweets & continues through application.
You can't tweet into someone's account without them first logging into your application through OAuth. You also can't tweet into someone's account when they do log in without their prior permission. That would be a violation of the Twitter TOS.
But you can help someone tweet about you without them logging in first. If you create a hyperlink with the URL form:
http://twitter.com/?status=[the text you want them to tweet]
When they click this link, the text you want them to tweet will be in the status box on their Twitter page. If they then click the tweet button, the tweet will be sent. You can use the search API to watch for these tweets, and do whatever you want to reward that user.
This is not spam, since the user chooses to send it. Not you. But it may be offensive, and it may get Twitter upset, if it happens too much.