Monday, July 9, 2012
Monday, July 2, 2012
FB Tab
My Father-in-law has this page on Facebook which is related to Astrology. He does a lot of work after his normal work to get stuff published to the site and let users have a good time reading the topics. He even answers them by email. Anyway, he wanted something set up on Facebook as a page and he sought my help.
I wanted to test this out myself, so I thought I should see how it is done. I ultimately went on to use a third party app which did the page/tab creation. I was not happy with myself.
The previous week I had to do a similar thing and this time I had more resources to work with. These are some of my observations and pointers to set up a simple tab in FB.
The tab setup is not straightforward in FB.
1. You will have to create an application which has the url (secure and non-secure) filled out. Make sure you select the 'Page Tab' option, fill in the Urls. Also remember to fill in the url in the Site URL field as well.
2. Remember that your page should have a maximum width of 810px. The default width is 520px (I used 810px)
3. The height adjusts with itself. So I don't think you will have to worry about that.
4. Use this url to add the created application as a tab to your page
http://www.facebook.com/dialog/pagetab?app_id=APP_ID&next=URL
I would suggest to use URL as http://www.facebook.com
5. Facebook posts a signed token to the URL you specified in the url field. It tries to use the non-secure one by default, but uses the secure one if FB was open as a secure connection.
6. Be careful if you intend to host the html file (end point HTML) in S3. Won't work. Simply because S3 treats POST requests as file uploads and gives out errors. As Facebook makes a POST request to the S3 URL you gave, you would probably see an unauthenticated message on the UI.
7. Better set up a server for the HTML and then add all the S3 stuff inside that !
That is pretty much it !
Labels:
development,
facebook,
internet,
page
Location:
Bergmannstraße 26, 10961 Berlin, Germany
Monday, May 21, 2012
More Tips
It's nice to be learning new stuff. I'm just going to write line by line of some more stuff that I learned ..
Always use UTF-8 as the default charset in Mysql.
I added this in my.cnf (/etc/)
If you are trying to sync between DBs, then take chunks of data.
Say you are trying to sync between DBs. And you want to do some transformation before sync (May be rename some columns). Then you would want to do a select query to get a subset of data (limit n) and then insert it in bulk using values (n values).
If there is a possibility of updates instead of inserts, then use the 'ON DUPLICATE KEY UPDATE' clause.
It's a good idea to update based on timestamps. What I did was that I touched a file everytime I do an update, so that the next time I know where I need to start from.
If a transaction fails because of Lock Errors write a retry routine in Code.
Lock might occur. Especially on DBs where there are a lot of reads/writes. So I would say try writing for x times and then raise an exception.
Optimize Active Admin if using with a DB with many records.
I have had this problem where the data in the table was HUGE and there were associations with another table with HUGE number of records. This caused the application to load very slowly and also made the writes to fail.
The fix that I made was to take out thos associations and write getters and setters instead of the associations. Some extra code, but make a HUGE difference to performance.
Use S3 when you want to store data.
The application had to generate reports and store them for future viewing. The flow in implementation is as follows
More to Come.
Always use UTF-8 as the default charset in Mysql.
I added this in my.cnf (/etc/)
[mysqld] default-character-set=utf8 default-collation=utf8_general_ci character-set-server=utf8 collation-server=utf8_general_ci init-connect='SET NAMES utf8' [client] default-character-set=utf8
If you are trying to sync between DBs, then take chunks of data.
Say you are trying to sync between DBs. And you want to do some transformation before sync (May be rename some columns). Then you would want to do a select query to get a subset of data (limit n) and then insert it in bulk using values (n values).
If there is a possibility of updates instead of inserts, then use the 'ON DUPLICATE KEY UPDATE' clause.
It's a good idea to update based on timestamps. What I did was that I touched a file everytime I do an update, so that the next time I know where I need to start from.
If a transaction fails because of Lock Errors write a retry routine in Code.
Lock might occur. Especially on DBs where there are a lot of reads/writes. So I would say try writing for x times and then raise an exception.
Optimize Active Admin if using with a DB with many records.
I have had this problem where the data in the table was HUGE and there were associations with another table with HUGE number of records. This caused the application to load very slowly and also made the writes to fail.
The fix that I made was to take out thos associations and write getters and setters instead of the associations. Some extra code, but make a HUGE difference to performance.
Use S3 when you want to store data.
The application had to generate reports and store them for future viewing. The flow in implementation is as follows
- User Creates Report
- He sets the report to execute on a specific time (he could also execute this report manually)
- On triggering of the report, a GeneratedReport is created and the job is pushed to delayed_job
- When the delayed_job gets to it, the report is executed and the result is written to a tmp file
- This tmp file is uploaded to S3 as a private file and a url is made with an expiration of months.
More to Come.
Labels:
activeadmin,
mysql,
rails,
ruby,
s3
Location:
Bergmannstraße 26, 10961 Berlin, Germany
Thursday, April 12, 2012
ARN Radio 96.7 Dubai in VLC
I have been listening to the malayalam radio station from Dubai (96.7) for some now. Its pretty good with news, greta anchors and good songs. To add it in VLC just add the stream.
http://4103.live.streamtheworld.com/HITAAC
is the url for the stream. Save the playlist too so that you could load it the next time.
Enjoy !
http://4103.live.streamtheworld.com/HITAAC
is the url for the stream. Save the playlist too so that you could load it the next time.
Enjoy !
Location:
Bergmannstraße, 10961 Berlin, Germany
Subscribe to:
Posts (Atom)
