1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How can I copy paste a list a very long Facebook search result list?

Discussion in 'PHP' started by zach catskilson, Feb 13, 2017.

  1. #1
    So here is something that I was stuck on for the past week.

    My task is to get a list of fans of a Facebook page - at the end, in a .txt format.

    Although the Facebook API doesn't share fans of a Facebook page that isn't yours, this information is publicly available when you search "People who like ________" in the search bar.

    For example: https://www.facebook.com/search/1708921982760465/likers

    The problem is that there are many likers, thousands - however this webpage list only shows 10, then you need to scroll down to load 10 more, and so-on. Not only would scrolling down for 10,000 likers be very time-consuming, but I believer it would be quite impossible to load such a long page in my browser without it crashing.

    My first way of solving this problem was to load keep scrolling and then copy paste the list. This method didn't work because my computer froze mid-way.

    Are there any alternative methods to getting this list? such as perhaps loading some text only html version of the page that won't crash the browser? Or maybe some script that would be able to send requests to obtain all the likers?

    Plz help.
     
    zach catskilson, Feb 13, 2017 IP
  2. Tanya Roberts

    Tanya Roberts Active Member

    Messages:
    250
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #2
    Not programming, just a concept.
    • Try checking what it shows while scrolling, and then you can fetch what it tries to load with some script [Hint: I got some request to "generic.php/BrowseScrollingSetPagelet"].
    • Make sure you set all those headers in cURL in php and one of the header has : "page_number":1,2,3,4... the page number you want
    • Now make a simple loop to fetch through all the page.
    • Now use some basic regex to or may use json_decode to fetch all the user there from the payload variable [NOTE: is not actually a JSON, but will be if you see the text there]
    Now you get what you have with a script with Facebook profile ID and Name, may have few more details but I haven't checked
     
    Tanya Roberts, Feb 15, 2017 IP
  3. zach catskilson

    zach catskilson Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Thanks for the detailed reply Tanya.
     
    zach catskilson, Feb 19, 2017 IP