{"action":"created","issue":{"url":"https://api.github.com/repos/jasonmayes/Twitter-Post-Fetcher/issues/74","repository_url":"https://api.github.com/repos/jasonmayes/Twitter-Post-Fetcher","labels_url":"https://api.github.com/repos/jasonmayes/Twitter-Post-Fetcher/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/jasonmayes/Twitter-Post-Fetcher/issues/74/comments","events_url":"https://api.github.com/repos/jasonmayes/Twitter-Post-Fetcher/issues/74/events","html_url":"https://github.com/jasonmayes/Twitter-Post-Fetcher/issues/74","id":138654507,"number":74,"title":"media images have an undefined source","user":{"login":"MrKarlDilkington","id":10898145,"avatar_url":"https://avatars3.githubusercontent.com/u/10898145?v=4","gravatar_id":"","url":"https://api.github.com/users/MrKarlDilkington","html_url":"https://github.com/MrKarlDilkington","followers_url":"https://api.github.com/users/MrKarlDilkington/followers","following_url":"https://api.github.com/users/MrKarlDilkington/following{/other_user}","gists_url":"https://api.github.com/users/MrKarlDilkington/gists{/gist_id}","starred_url":"https://api.github.com/users/MrKarlDilkington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrKarlDilkington/subscriptions","organizations_url":"https://api.github.com/users/MrKarlDilkington/orgs","repos_url":"https://api.github.com/users/MrKarlDilkington/repos","events_url":"https://api.github.com/users/MrKarlDilkington/events{/privacy}","received_events_url":"https://api.github.com/users/MrKarlDilkington/received_events","type":"User","site_admin":false},"labels":[{"id":116615294,"url":"https://api.github.com/repos/jasonmayes/Twitter-Post-Fetcher/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-03-05T06:43:56Z","updated_at":"2017-11-16T08:02:11Z","closed_at":"2016-07-11T16:49:52Z","author_association":"CONTRIBUTOR","body":"@jasonmayes \n\nFirst off, I want to thank you for creating and maintaining Twitter-Post-Fetcher. It is a great tool and I really appreciate it.\n\nWith the recent Twitter changes, I was curious to know if anyone has encountered img elements being displayed with undefined src, with `\"showImages\": true`? I looked through existing issues and did not see any references to it.\n\n**Example 1**\n\nHTML\n\n```\n<div class=\"media\">\n    <img src=\"undefined\" alt=\"Image from tweet\">\n</div>\n```\n\nDisplayed HTML\n![preview1](https://cloud.githubusercontent.com/assets/10898145/13545885/cde6708a-e268-11e5-9c23-3e167b317b19.png)\n\nOriginal Tweet\n![tweet1](https://cloud.githubusercontent.com/assets/10898145/13545886/d48ee03e-e268-11e5-894b-f4afc89604c3.png)\n\nimages[n]\n\n```\n<div class=\"timeline-Tweet-media\">\n    <div class=\"PrerenderedCard\" data-card-name=\"summary_large_image\" data-css=\"https://ton.twimg.com/tfw/css/syndication_bundle_v1_826d162568fd5604ef605f485c8050cdbc7a7b99.css\" data-scribe=\"component:card\">\n        <div class=\"TwitterCardsGrid TwitterCard\">\n            <script type=\"text/twitter-cards-serialization\">\n                { \"strings\": { }, \"card\": { \"forward\" : \"false\", \"is_logged_in\" : false, \"is_author\" : false, \"language\" : \"en\", \"card_name\" : \"summary_large_image\", \"token\" : \"\", \"card_uri\" : \"https://t.co/DQbE7e5l77\", \"tweet_id\" : \"705821491758141440\", \"card_url\" : \"https://t.co/DQbE7e5l77\" }, \"scribeData\": { \"card_name\": \"summary_large_image\", \"card_url\": \"https://t.co/DQbE7e5l77\" } }\n            </script>\n            <div class=\"TwitterCardsGrid-col--12 TwitterCardsGrid-col--spacerBottom CardContent\">\n                <a class=\" js-openLink u-block TwitterCardsGrid-col--12 TwitterCard-container TwitterCard-container--clickable SummaryCard--small\" href=\"https://t.co/DQbE7e5l77\">\n                    <div class=\"SummaryCard-image TwitterCardsGrid-float--prev\">\n                        <div class=\"tcu-imageContainer tcu-imageAspect--1to1\">\n                            <style>\n                            .tcu-image-705821491758141440 {\n                                background-size: 3em !important;\n                            }\n                            </style>\n                            <div class=\"tcu-imageWrapper tcu-image-705821491758141440 js-cspForcedStyle\" data-style=\"background-size: 3em;\">\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"SummaryCard-contentContainer TwitterCardsGrid-float--prev\">\n                        <div class=\"SummaryCard-content\">\n                            <h2 class=\"TwitterCard-title js-cardClick tcu-textEllipse--multiline\">Looks like interacting in Virtual Reality is a lot better than a few years…</h2>\n                            <p class=\"tcu-resetMargin u-block TwitterCardsGrid-col--spacerTop tcu-textEllipse--multiline\">Looks like interacting in Virtual Reality is a lot better than a few years back. But maybe it is a little too good! Check out the dangers too in the video… - Jason Mayes - Google+</p>\n                            <span class=\"u-block TwitterCardsGrid-col--spacerTop SummaryCard-destination\">plus.google.com</span>\n                        </div>\n                    </div>\n                </a>\n            </div>\n        </div>\n    </div>\n</div>\n```\n\n**Example 2**\n\nHTML\n\n```\n<div class=\"media\">\n    <img src=\"undefined\" alt=\"Image from tweet\">\n</div>\n```\n\nDisplayed HTML\n![preview2](https://cloud.githubusercontent.com/assets/10898145/13545887/db220066-e268-11e5-8c08-bd300d802b64.png)\n\nOriginal Tweet\n![tweet2](https://cloud.githubusercontent.com/assets/10898145/13545899/381de69a-e269-11e5-908b-cc13240cf32d.jpg)\n\nimages[n]\n\n```\n<div class=\"timeline-Tweet-media\">\n    <article class=\"MediaCard\n           MediaCard--mediaForward\n\n           cards-multimedia\n           customisable-border\" data-scribe=\"component:card\" dir=\"ltr\">\n        <div class=\"MediaCard-media\">\n            <div class=\"MediaCard-widthConstraint js-cspForcedStyle\" style=\"max-width: 800px\" data-style=\"max-width: 800px\">\n                <div class=\"MediaCard-mediaContainer js-cspForcedStyle\" style=\"padding-bottom: 100.0000%\" data-style=\"padding-bottom: 100.0000%\">\n                    <a href=\"https://twitter.com/TwitterDev/status/705436774441623554\" class=\"MediaCard-mediaAsset MediaCard-mediaPlaceholder\n                    NaturalImage NaturalImage--fill\n\n                    js-playableMediaInterstitial\">\n                        <div class=\"NaturalImage-ctaOverlay PlayButton PlayButton--centered\" data-scribe=\"element:play_button\">\n                            <div class=\"Icon Icon--playCircle \" aria-label=\"Play Media\" title=\"Play Media\" role=\"img\"></div>\n                        </div>\n                        <img class=\"NaturalImage-image\" src=\"https://pbs.twimg.com/tweet_video_thumb/Cco29woW8AAMqS3.jpg\" alt=\"\" data-scribe=\"element:poster_image\">\n                    </a>\n                </div>\n            </div>\n        </div>\n    </article>\n</div>\n```\n\nAlthough a bit crude, adding a check to see if the result of extractImageUrl() is not undefined appears to work.\n\n```\nif (showImages && images[n] !== undefined && extractImageUrl(images[n]) !== undefined) {\n  op += '<div class=\"media\">' +\n      '<img src=\"' + extractImageUrl(images[n]) +\n      '\" alt=\"Image from tweet\" />' + '</div>';\n}\n```\n\nAlso, are you open to a pull request that adds a config option for choosing between data-src-1x and data-src-2x?\n"},"comment":{"url":"https://api.github.com/repos/jasonmayes/Twitter-Post-Fetcher/issues/comments/344844681","html_url":"https://github.com/jasonmayes/Twitter-Post-Fetcher/issues/74#issuecomment-344844681","issue_url":"https://api.github.com/repos/jasonmayes/Twitter-Post-Fetcher/issues/74","id":344844681,"user":{"login":"MrKarlDilkington","id":10898145,"avatar_url":"https://avatars3.githubusercontent.com/u/10898145?v=4","gravatar_id":"","url":"https://api.github.com/users/MrKarlDilkington","html_url":"https://github.com/MrKarlDilkington","followers_url":"https://api.github.com/users/MrKarlDilkington/followers","following_url":"https://api.github.com/users/MrKarlDilkington/following{/other_user}","gists_url":"https://api.github.com/users/MrKarlDilkington/gists{/gist_id}","starred_url":"https://api.github.com/users/MrKarlDilkington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrKarlDilkington/subscriptions","organizations_url":"https://api.github.com/users/MrKarlDilkington/orgs","repos_url":"https://api.github.com/users/MrKarlDilkington/repos","events_url":"https://api.github.com/users/MrKarlDilkington/events{/privacy}","received_events_url":"https://api.github.com/users/MrKarlDilkington/received_events","type":"User","site_admin":false},"created_at":"2017-11-16T08:02:10Z","updated_at":"2017-11-16T08:02:10Z","author_association":"CONTRIBUTOR","body":"@maksimbormot \r\n\r\nPlease include more specific details about the issue you are experiencing. An example Twitter feed for testing would also be helpful."}}
{"actor":{"display_login":"MrKarlDilkington"}}