-
Notifications
You must be signed in to change notification settings - Fork 3
Howto
Before installing Twitter-OpenSim in your server, you need:
- Server with PHP5 and MySQL (your OpenSim server migth not have PHP or MySQL installed), for PHP install Apache too.
- At least 5mb free for user files
User information is stored on the server as a file (soon MySQL). Make sure you follow this guide to the letter to get user information as secure as possible.
To determine if your server supports Twitter-OpenSim, download files from github/deviSAS and point your browser to: http://url|localhost/twitter-opensim/twitter.php. You should see the following screen if the service works:
![Preview] (http://foravatars.com/files/wiki-images/installed.jpg)
To enable the users to use this service, the server must communicate to Twitter through an application, this application appears in the tweets sent by users and links to your website. To register an application go to http://dev.twitter.com/ enter your Twitter account. Click on 'Your Apps' and 'Register a new App'.
![Preview] (http://foravatars.com/files/wiki-images/twitter_register.jpg)
![Preview] (http://foravatars.com/files/wiki-images/register_twitter.jpg)
- In Application Name place the name of your application, this name will appear when the user uses the tool.
- In Description place a short description of your application.
- In Application Website place a URL where people can find information about the app or your OpenSim.
- In Application Type SELECT BROWSER.
- In Callback URL place the URL where your callback.php file is hosted. E.g: http://url|localhost/twitter-opensim/callback.php
- Select in Default access type 'Read, Write, & Direct Messages' if you need direct messages permissions or 'Read & Write' for a general service (Recommended).
- If you have an image-logo of your application upload it.
Fill in the captcha code and register your application
Created on twitter application, we must edit the file 'tokens.php'. This file is designed so that it can accept multiple applications at the time (if you manage different grids and wants tweets appear with a different application for example).
To edit the file correctly, look closely the format used in it:
![Preview] (http://foravatars.com/files/wiki-images/tokens.jpg)
First change the sid_secure string define('sid_secure', '23dia2342dasl');, with a random code, e.g: define('sid_secure', 'my_secure_C0d3');
This code is used temporarily to protect user information, the file will be named with this code so do not use illegal characters as *'/:[]{} among others.
If you have more themes installed, you can activate them by changing the default.php in 'theme'.
Now add the information from the twitter application on file for this, replace only the information between 'CONSUMER_KEY_HERE' and 'CONSUMER_SECRET_HERE' quotes.
![Preview] (http://foravatars.com/files/wiki-images/consumer.jpg)
Copy and paste this information from your Twitter application.
![Preview] (http://foravatars.com/files/wiki-images/consumer_twitter.jpg)
In the downloaded package, you find a sample code LSL, allowing you to test the server. This demo performs user authentication and allows you to tweet from OpenSim, for installation on your server follow these steps:
- Create a box
- In this object create a new script and paste the code found in the folder
lsl.
![Preview] (http://foravatars.com/files/wiki-images/create_opensim.jpg)
- Modify line 15 to the URL where the file twitter.php is, on line 16 put your CONSUMER_KEY (which you copied earlier), the CONSUMER_SECRET is not necessary as this code is only delivered by PHP when a request is made.
![Preview] (http://foravatars.com/files/wiki-images/mod_opensim.jpg)
- Save the code and watch the general chat, the message 'My public url is: http://PUBLIC_URL' must contain a web address from which you can access the object, if this url is not valid e.g: http://server0123:XXXX/..../ you can not access from outside the network because the server name is not public, in this case you must place the server name and URL or IP for which you want to replace in lines 12 and 13 (SERVER, URL).
![Preview] (http://foravatars.com/files/wiki-images/server_opensim.jpg)
Configured the application, you will read the chat message: Primitive: Type /12 Status here' to update your twitter status., to send a tweet, type /12 My tweet here!. Then a window will take you to twitter.
![Preview] (http://foravatars.com/files/wiki-images/login_opensim.jpg)
From Twitter page, login with your account and allow permissions to the application.
![Preview] (http://foravatars.com/files/wiki-images/login_twitter.jpg)
Accepted permissions, you will see the following window. You can now tweet without logging into twitter because your session data has been stored on the web.
![Preview] (http://foravatars.com/files/wiki-images/loggedin_opensim.jpg)
![Preview] (http://foravatars.com/files/wiki-images/tweet.jpg)