kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.45k stars 633 forks source link

Possible to sort group feeds chronologically? (?sorting_setting=CHRONOLOGICAL) #935

Open nadir7379 opened 1 year ago

nadir7379 commented 1 year ago

On the desktop web version of Facebook, you are able to sort group feeds in three different ways:

image

The issue we face now is: We would like to sort our group feeds by 'Newest posts', on the mobile web version however (m.facebook.com) this option cannot be found. Per default, feeds are sorted by 'Newest activity' (on mobile).

On the desktop web version of Facebook, adding the parameter ?sorting_setting=CHRONOLOGICAL does the job. However, for mobile URLs this does not work.

Therefore: Is there any way to sort group feeds chronologically on mobile?

sagihgithub commented 1 year ago

Hi Did you find an answer ?

zeglin commented 1 year ago

I'm also interested in this and trying to find a solution to sort mbasic or mobile chronologically.

henriquetguedes commented 1 year ago

I added ?sorting_setting=CHRONOLOGICAL in line 45 of page_iterators.py after the last forward-slash (the string being formatted with the group name/id) and it seems not to have broken anything. Hard to tell if the results are perfectly consistent with the Chronological sort, as I don't want to get banned for good and would need a deeper scrape to ascertain that, but no evidence saying otherwise so far.

seems to help with issues #518 and #998

s22f32dd commented 1 year ago

I added ?sorting_setting=CHRONOLOGICAL in line 45 of page_iterators.py after the last forward-slash (the string being formatted with the group name/id) and it seems not to have broken anything. Hard to tell if the results are perfectly consistent with the Chronological sort, as I don't want to get banned for good and would need a deeper scrape to ascertain that, but no evidence saying otherwise so far.

seems to help with issues #518 and #998

did you mean this way? start_url = utils.urljoin(FB_MOBILE_BASE_URL, f'groups/{group}/?sorting_setting=CHRONOLOGICAL')

I tried this and unfortunately this is not working for me. Maybe I am doing something wrong?

henriquetguedes commented 1 year ago

Precisely. I thought it worked back then, maybe not but I've had to pause the project.