yshalsager / facebook2rss

Turn Facebook feeds into RSS!
GNU General Public License v3.0
34 stars 5 forks source link

Support other-than-English interfaces? #5

Closed fabienli closed 3 years ago

fabienli commented 3 years ago

In class ProfilePage (file pqges/mbasic/Profile.py) the posts are identify by the text "Full Story" displayed:

def posts_selector(self):
    return '//a[contains(@href, "/story.php?") and contains(text(), "Full Story")]'

if the user's default interface language is not English, the text is localized from facebook's settings language, then it might not be "Full Story". I've checked with a French interface, and the script is working by adapting the below line:

def posts_selector(self):
    return '//a[contains(@href, "/story.php?") and (contains(text(), "Full Story") or contains(text(), "Actualité intégrale"))]'

obviously, this change would not scale with any langugage, so I'm not submitting a PR with this modification. In a short term view, I would accept this as a limitation.

Do you have any idea for the long term support ? Either we need to find a way to identify this part for all languages; or the identification should not rely on the displayed text.

yshalsager commented 3 years ago

I think a good way to handle this would be: