0

some of the questions i have read http://facebook.stackoverflow.com/questions/1927676/scraping-a-facebook-app-for-data

http://facebook.stackoverflow.com/questions/2028940/access-to-facebook-data

I want to create a spreadsheet that will contain all the diff items that i have in a facebook game, i.e. weapons Armour. I thought this would be fairly easy. I have created a some experience with c++, javascript, php, and to a lesser extent python. I have been able to import the Items to an excel spreadsheet. but it imports every thing on the webpage. and i would like to be able to have seperate sprreadsheets for each type of item and have the spread sheet update automaticly. so i went to the google data api. an the problem there is that facebook wont let my google spreadsheet script access anything it redirects me to the login page(or atleast that is what i suspect because when i run the debug it shows the a redirected url). then i read about how javascript does not work coss domain.cross domain javascript. and sience google spript is java based i thought that that might be the problem. so I went to scraperwikihttps://scraperwiki.com/ and created a spript there in php thinking that would solve the problem. Now i should mention that i have tested if i can access this page without being loged into facebook (meaning i logged out of facebook and called the site and i was able to pull the site up in the browser and use a java shell to get the data i wanted. then when i click another link that requirs me to belogged into facebook the login screen would show up i would click the bookmark to the page i want to get the data from and i can see it and get the data from javashell.)

So after that long story my questions are 1. will oauth solve this road block?

  1. if i created a FB app would i be able to get the data i wanted and then be able to get it to the google spreadsheet?

  2. would something like Watin https://stackoverflow.com/questions/tagged/watin be a better way? (I have no idea what it is capable of)

Community
  • 1
  • 1
Claire Nagle
  • 69
  • 1
  • 6
  • another thing i am looking at is bookmaklets. if I could get a script to run when i had the browser open it could call the page i want to get the data off of then import it to the spreadsheet. and i think i could just leave the browser open and have a scheduled task run the booklet. – Claire Nagle Nov 01 '12 at 03:49
  • after reading this link it looks like a bookmarklet might just work [http://stackoverflow.com/questions/2128367/scripting-a-google-docs-form-submission] – Claire Nagle Nov 01 '12 at 05:45

1 Answers1

0

updated with working solution!!

To all you rookie programmers like me. stop and take a break! I have been trying to work this out for weeks. I have read countless numbers of blogs, posts, tutorials, I have learned 3 new languages (well enough to make my head hurt). Studied I don't know how many web tool, scraper sites, app engines, browser extensions, and i a bunch of other junk that i cant even remember. Some of witch might work faster. but after days of nothing but frustration and head aches. it seem old school is the way to go. I seen this post when i first started researching I need to scrape data from a Facebook game - using ruby but i passed on the idea of ruby because everything now a days. seems to like java, php, python or Jquery. In the end ruby saved me from more head aches. You still need to figure some things out for your self but if you use these tips hopefully it will be easier on you than it was on me!!

I downloaded with the windows installer. download ruby

I used google chrome to inspect the elements because it highlights the place on the screen for the element that your are hovering over.

here is some starter code

require 'rubygems'
require 'watir-webdriver' # or whichever gem you choose
require 'google_drive'
b = Watir::Browser.new
b.goto 'facebookgame url'
b.text_field(:id => 'email').set 'your email'
b.text_field(:id => 'pass').set 'your passwork'
b.button(:name => 'login').click
b.goto 'next url' # or find/get element value
Community
  • 1
  • 1
Claire Nagle
  • 69
  • 1
  • 6
  • I had to but these links here because i was limited to two hyperlinks use this driver [http://watirwebdriver.com/] used this to get to Google spreadsheet [https://github.com/gimite/google-drive-ruby] – Claire Nagle Nov 02 '12 at 11:17
  • here is another good link [http://wtr.rubyforge.org/rdoc/1.6.2/classes/Watir/Element.html] – Claire Nagle Nov 02 '12 at 11:40
  • I used notepad++ to right the code [http://notepad-plus-plus.org/] to write the code but i found it was much easier to test using the command line – Claire Nagle Nov 02 '12 at 12:15