jshemas / openGraphScraper

Node.js scraper service for Open Graph Info and More!
MIT License
643 stars 102 forks source link

fix: check if script text is non null before parsing #230

Closed manan19 closed 6 days ago

jshemas commented 1 week ago

Thanks for the PR!

Do you have any examples of real world websites where this happens?

jshemas commented 1 week ago

Can you also fix the eslint errors? npm run eslint

manan19 commented 1 week ago

Thanks for the PR! Do you have any examples of real world websites where this happens?

https://objkt.com/landing/objkt-paint?utm_source=warpcast&utm_medium=organic&utm_campaign=objktpaint98

with following custom metatags

const custom_meta_tags = [
    {
        multiple: false,
        property: 'fc:frame',
        fieldName: 'frame',
    },
    {
        multiple: false,
        property: 'fc:frame:image',
        fieldName: 'frame_image',
    },
    {
        multiple: false,
        property: 'fc:frame:image:aspect_ratio',
        fieldName: 'frame_image_aspect_ratio',
    },
    {
        multiple: false,
        property: 'fc:frame:button:1',
        fieldName: 'frame_button_1',
    },
    {
        multiple: false,
        property: 'fc:frame:button:2',
        fieldName: 'frame_button_2',
    },
    {
        multiple: false,
        property: 'fc:frame:button:3',
        fieldName: 'frame_button_3',
    },
    {
        multiple: false,
        property: 'fc:frame:button:4',
        fieldName: 'frame_button_4',
    },
    {
        multiple: false,
        property: 'fc:frame:button:1:action',
        fieldName: 'frame_button_1_action',
    },
    {
        multiple: false,
        property: 'fc:frame:button:2:action',
        fieldName: 'frame_button_2_action',
    },
    {
        multiple: false,
        property: 'fc:frame:button:3:action',
        fieldName: 'frame_button_3_action',
    },
    {
        multiple: false,
        property: 'fc:frame:button:4:action',
        fieldName: 'frame_button_4_action',
    },
    {
        multiple: false,
        property: 'fc:frame:button:1:target',
        fieldName: 'frame_button_1_target',
    },
    {
        multiple: false,
        property: 'fc:frame:button:2:target',
        fieldName: 'frame_button_2_target',
    },
    {
        multiple: false,
        property: 'fc:frame:button:3:target',
        fieldName: 'frame_button_3_target',
    },
    {
        multiple: false,
        property: 'fc:frame:button:4:target',
        fieldName: 'frame_button_4_target',
    },
    {
        multiple: false,
        property: 'fc:frame:button:1:post_url',
        fieldName: 'frame_button_1_post_url',
    },
    {
        multiple: false,
        property: 'fc:frame:button:2:post_url',
        fieldName: 'frame_button_2_post_url',
    },
    {
        multiple: false,
        property: 'fc:frame:button:3:post_url',
        fieldName: 'frame_button_3_post_url',
    },
    {
        multiple: false,
        property: 'fc:frame:button:4:post_url',
        fieldName: 'frame_button_4_post_url',
    },
    {
        multiple: false,
        property: 'fc:frame:post_url',
        fieldName: 'frame_post_url',
    },
    {
        multiple: false,
        property: 'fc:frame:refresh_period',
        fieldName: 'frame_refresh_period',
    },
    {
        multiple: false,
        property: 'og:title',
        fieldName: 'frame_title',
    },
    {
        multiple: false,
        property: 'fc:frame:input:text',
        fieldName: 'frame_input_text',
    },
    {
        multiple: false,
        property: 'fc:frame:refresh_period',
        fieldName: 'frame_refresh_period',
    },
    {
        multiple: false,
        property: 'fc:frame:state',
        fieldName: 'frame_state_serialized',
    },
];
jshemas commented 6 days ago

Thanks for the PR!