-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdata_test.go
7 lines (4 loc) · 16.4 KB
/
data_test.go
1
2
3
4
5
6
7
package parsefb
var testhtml1 = `<div class="_5pcb"><h2 class="accessible_elem" id="newsFeedHeading">News Feed</h2><div class="_4-u2 mbm _5jmm _5pat _5v3q _5uun _4-u8" data-ft="{"fbfeed_location":5}" data-fte="1" data-ftr="1" data-testid="permalink_stream_story" id="u_0_9"><div class="_3ccb" data-gt="{"type":"click2canvas","fbsource":703,"ref":"nf_generic"}" id="u_0_a"><div></div><div class="fbUserContent _5pcr" role="article" aria-label="Story"><div class="_1dwg _1w_m _2ph_"><div class="_4r_y"><div></div></div><div class="_4gns accessible_elem"></div><div><span class="_47we _42b7"></span><div class="_5x46"><div class="clearfix _5va3"><a class="_5pb8 _8o _8s lfloat _ohe" href="https://www.facebook.com/jayasaro.panyaprateep.org/?ref=nf" aria-hidden="true" tabindex="-1" target="" data-ft="{"tn":"\\u003C"}"><div class="_38vo"><img class="_s0 _5xib _5sq7 _44ma _rw img" src="https://scontent-tpe1-1.xx.fbcdn.net/v/t1.0-1/c49.39.490.490/s50x50/3443_354138744694818_352652477_n.jpg?oh=c708a16b5959043a81bc685ff754ad25&oe=5947A5C8" alt="" /></div></a><div class="clearfix _42ef"><div class="rfloat _ohf"></div><div class="_5va4"><div><div class="_6a _5u5j"><div class="_6a _6b" style="height:40px"></div><div class="_6a _5u5j _6b"><h5 class="_5pbw _5vra" data-ft="{"tn":"C"}"><span class="fwn fcg"><span class="fwb fcg" data-ft="{"tn":"k"}"><a href="https://www.facebook.com/jayasaro.panyaprateep.org/?fref=nf">ธรรมะ โดย พระอาจารย์ชยสาโร/ Dhamma by Ajahn Jayasaro<a href="https://www.facebook.com/jayasaro.panyaprateep.org/?fref=nf"></a></a></span></span></h5><div class="_5pcp _5lel"><span class="_5paw _14zs" data-ft="{"tn":"j"}"><a class="_3e_2 _14zr" href="#"></a></span><span role="presentation" aria-hidden="true"> · </span><span><span class="fsm fwn fcg"><a class="_5pcq" href="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1095007907274561/?type=3" rel="theater" ajaxify="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1095007907274561/?type=3&size=371%2C336&fbid=1095007907274561&source=12&player_origin=story_view" target=""><abbr title="Wednesday, February 15, 2017 at 3:00pm" data-utime="1487199600" data-shorten="1" class="_5ptz timestamp livetimestamp"><span class="timestampContent">16 hrs</span></abbr></a></span></span><span role="presentation" aria-hidden="true"> · </span><a data-hover="tooltip" data-tooltip-content="Public" class="uiStreamPrivacy inlineBlock fbStreamPrivacy fbPrivacyAudienceIndicator _5pcq" aria-label="Public" href="#" role="button"><img class="lock img" src="https://www.facebook.com/rsrc.php/v3/yB/r/-pz5JhcNQ9P.png" alt="" width="12" height="12" /></a></div></div></div></div></div></div></div></div><div class="_5pbx userContent" data-ft="{"tn":"K"}"><p>สมัยก่อนหลวงพ่อชาชอบฝึกลูกศิษย์ลูกหาด้วยการทรมานกิเลสของศิษย์ การทรมานกิเลสไม่ใช่ทรมานกาย ไม่ใช่เรื่องโหดร้าย ตรงกันข้าม การทรมานกิเลสคือวิธีเปิดเผยความสัมพันธ์ระหว่างอริยสัจคือทุกข์และอริยสัจคือสมุทัย ด้วยการไม่ให้ศิษย์ทำอะไรบางอย่างตามใจชอบ เช่นในโรงฉันหลวงพ่อเคยบอกว่า ‘ท่านต้องการเร็ว ผมจะให้ช้า ท่านต้องการร้อน ผมจะให้เย็น’ เมื่อหลวงพ่อไม่ให้ทำสิ่งที่อยากทำ หรือได้ในสิ่งที่อยากได้ แต่กลับให้ทำในสิ่งที่ไม่อยากทำ ได้ในสิ่งที่ไม่อยากได้ ศิษย์มักจะอึดอัด กระวนกระวายเป็นทุกข์ ตรงนี้หลวงพ่อจะสอนว่า ทุกข์ไหม ทุกข์ทำไม พระองค์ไหนมีสติปัญญาพอก็จะเห็นว่าตัณหาไม่ได้อยู่ที่หลวงพ่อหรือเหตุการณ์ ที่จริงมันอยู่ที่ตัณหา ความอยากได้ อยากมี อยากเป็น ความไม่อยากได้ ไม่อยากมี ไม่อยากเป็นต่างหาก</p><p> หลวงพ่อชาไม่ต้องสอนหลักปริยัติมาก หลวงพ่อสอนแต่พอสมควร พอเป็นหลัก แล้วคอยสร้างเหตุการณ์เพื่อให้ลูกศิษย์ได้เห็นเองเป็นปัจจัตตัง</p><p> พระอาจารย์ชยสาโร</p></div><div class="_3x-2"><div data-ft="{"tn":"H"}"><div class="mtm"><div class="_5cq3" data-ft="{"tn":"E"}"><a class="_4-eo _2t9n" href="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1095007907274561/?type=3" rel="theater" ajaxify="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1095007907274561/?type=3&size=371%2C336&fbid=1095007907274561&player_origin=story_view" data-render-location="permalink" style="width:476px;" data-testid="theater_link"><div class="uiScaledImageContainer _4-ep" style="width:476px;height:431px;" id="u_0_c"><img class="scaledImageFitWidth img" src="https://scontent-tpe1-1.xx.fbcdn.net/v/t1.0-9/15977852_1095007907274561_6746026653352133673_n.jpg?oh=f65c3bc965f0bd0e336eff2dd0d5f4e9&oe=592D9A42" alt="Image may contain: 1 person" width="476" height="432" /></div></a></div></div></div></div><div></div></div></div><div><form rel="async" class="commentable_item collapsed_comments" method="post" data-ft="{"tn":"]"}" action="/ajax/ufi/modify.php" onsubmit="return window.Event && Event.__inlineSubmit && Event.__inlineSubmit(this,event)" id="u_0_e"><input type="hidden" name="lsd" value="AVq1bEX1" autocomplete="off" /><input type="hidden" autocomplete="off" name="ft_ent_identifier" value="1095007907274561" /><input type="hidden" autocomplete="off" name="data_only_response" value="1" /><div class="_sa_ _5vsi _192z"><div class="_37uu"></div></div><div class="uiUfi UFIContainer _5pc9 _5vsj _5v9k" id="u_0_d"></div></form></div></div></div></div></div>`
var testhtml2 = `<div class="_5pcb"><h2 class="accessible_elem" id="newsFeedHeading">News Feed</h2><div class="_4-u2 mbm _5jmm _5pat _5v3q _5uun _4-u8" data-ft="{"fbfeed_location":5}" data-fte="1" data-ftr="1" data-testid="permalink_stream_story" id="u_0_9"><div class="_3ccb" data-gt="{"type":"click2canvas","fbsource":703,"ref":"nf_generic"}" id="u_0_a"><div></div><div class="fbUserContent _5pcr" role="article" aria-label="Story"><div class="_1dwg _1w_m _2ph_"><div class="_4r_y"><div></div></div><div class="_4gns accessible_elem"></div><div><span class="_47we _42b7"></span><div class="_5x46"><div class="clearfix _5va3"><a class="_5pb8 _8o _8s lfloat _ohe" href="https://www.facebook.com/jayasaro.panyaprateep.org/?ref=nf" aria-hidden="true" tabindex="-1" target="" data-ft="{"tn":"\\u003C"}"><div class="_38vo"><img class="_s0 _5xib _5sq7 _44ma _rw img" src="https://scontent-tpe1-1.xx.fbcdn.net/v/t1.0-1/c49.39.490.490/s50x50/3443_354138744694818_352652477_n.jpg?oh=c708a16b5959043a81bc685ff754ad25&oe=5947A5C8" alt="" /></div></a><div class="clearfix _42ef"><div class="rfloat _ohf"></div><div class="_5va4"><div><div class="_6a _5u5j"><div class="_6a _6b" style="height:40px"></div><div class="_6a _5u5j _6b"><h5 class="_5pbw _5vra" data-ft="{"tn":"C"}"><span class="fwn fcg"><span class="fcg"><span class="fwb"><a class="profileLink" href="https://www.facebook.com/jayasaro.panyaprateep.org/" data-ft="{"tn":"k"}">ธรรมะ โดย พระอาจารย์ชยสาโร/ Dhamma by Ajahn Jayasaro<a href="https://www.facebook.com/jayasaro.panyaprateep.org/"></a></a></span> added a new photo.</span></span></h5><div class="_5pcp _5lel"><span class="_5paw _14zs" data-ft="{"tn":"j"}"><a class="_3e_2 _14zr" href="#"></a></span><span role="presentation" aria-hidden="true"> · </span><span><span class="fsm fwn fcg"><a class="_5pcq" href="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1119567364818615/?type=3" rel="theater" ajaxify="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1119567364818615/?type=3&size=2048%2C1574&fbid=1119567364818615&source=12&player_origin=story_view" target=""><abbr title="Tuesday, February 14, 2017 at 3:00pm" data-utime="1487113202" data-shorten="1" class="_5ptz"><span class="timestampContent">February 14 at 3:00pm</span></abbr></a></span></span><span role="presentation" aria-hidden="true"> · </span><a data-hover="tooltip" data-tooltip-content="Public" class="uiStreamPrivacy inlineBlock fbStreamPrivacy fbPrivacyAudienceIndicator _5pcq" aria-label="Public" href="#" role="button"><img class="lock img" src="https://www.facebook.com/rsrc.php/v3/yB/r/-pz5JhcNQ9P.png" alt="" width="12" height="12" /></a></div></div></div></div></div></div></div></div><div class="userContent"></div><div class="_3x-2"><div data-ft="{"tn":"H"}"><div class="mtm"><div class="_5cq3" data-ft="{"tn":"E"}"><a class="_4-eo _2t9n" href="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1119567364818615/?type=3" rel="theater" ajaxify="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1119567364818615/?type=3&size=2048%2C1574&fbid=1119567364818615&player_origin=story_view" data-render-location="permalink" style="width:476px;" data-testid="theater_link"><div class="uiScaledImageContainer _4-ep" style="width:476px;height:365px;" id="u_0_c"><img class="scaledImageFitHeight img" src="https://scontent-tpe1-1.xx.fbcdn.net/v/t1.0-0/q81/s480x480/16730470_1119567364818615_7687113058712125895_n.jpg?oh=06d207eb398ee400cc8ca8c23ab4e329&oe=594B829A" style="left:0px;" alt="Image may contain: text" width="477" height="365" /></div></a></div></div></div></div><div></div></div></div><div><form rel="async" class="commentable_item collapsed_comments" method="post" data-ft="{"tn":"]"}" action="/ajax/ufi/modify.php" onsubmit="return window.Event && Event.__inlineSubmit && Event.__inlineSubmit(this,event)" id="u_0_e"><input type="hidden" name="lsd" value="AVq1bEX1" autocomplete="off" /><input type="hidden" autocomplete="off" name="ft_ent_identifier" value="1119567364818615" /><input type="hidden" autocomplete="off" name="data_only_response" value="1" /><div class="_sa_ _5vsi _192z"><div class="_37uu"></div></div><div class="uiUfi UFIContainer _5pc9 _5vsj _5v9k" id="u_0_d"></div></form></div></div></div></div></div>`
var testhtml3 = `<div class="_5pcb"><h2 class="accessible_elem" id="newsFeedHeading">News Feed</h2><div class="_4-u2 mbm _5jmm _5pat _5v3q _5uun _4-u8" data-ft="{"fbfeed_location":5}" data-fte="1" data-ftr="1" data-testid="permalink_stream_story" id="u_0_9"><div class="_3ccb" data-gt="{"type":"click2canvas","fbsource":703,"ref":"nf_generic"}" id="u_0_a"><div></div><div class="fbUserContent _5pcr" role="article" aria-label="Story"><div class="_1dwg _1w_m _2ph_"><div class="_4r_y"><div></div></div><div class="_4gns accessible_elem"></div><div><span class="_47we _42b7"></span><div class="_5x46"><div class="clearfix _5va3"><a class="_5pb8 _8o _8s lfloat _ohe" href="https://www.facebook.com/jayasaro.panyaprateep.org/?ref=nf" aria-hidden="true" tabindex="-1" target="" data-ft="{"tn":"\\u003C"}"><div class="_38vo"><img class="_s0 _5xib _5sq7 _44ma _rw img" src="https://scontent-tpe1-1.xx.fbcdn.net/v/t1.0-1/c49.39.490.490/s50x50/3443_354138744694818_352652477_n.jpg?oh=c708a16b5959043a81bc685ff754ad25&oe=5947A5C8" alt="" /></div></a><div class="clearfix _42ef"><div class="rfloat _ohf"></div><div class="_5va4"><div><div class="_6a _5u5j"><div class="_6a _6b" style="height:40px"></div><div class="_6a _5u5j _6b"><h5 class="_5pbw _5vra" data-ft="{"tn":"C"}"><span class="fwn fcg"><span class="fcg"><span class="fwb"><a class="profileLink" href="https://www.facebook.com/jayasaro.panyaprateep.org/" data-ft="{"tn":"k"}">ธรรมะ โดย พระอาจารย์ชยสาโร/ Dhamma by Ajahn Jayasaro<a href="https://www.facebook.com/jayasaro.panyaprateep.org/"></a></a></span> added a new photo.</span></span></h5><div class="_5pcp _5lel"><span class="_5paw _14zs" data-ft="{"tn":"j"}"><a class="_3e_2 _14zr" href="#"></a></span><span role="presentation" aria-hidden="true"> · </span><span><span class="fsm fwn fcg"><a class="_5pcq" href="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1119561951485823/?type=3" rel="theater" ajaxify="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1119561951485823/?type=3&size=1995%2C1259&fbid=1119561951485823&source=12&player_origin=story_view" target=""><abbr title="Tuesday, February 14, 2017 at 12:16am" data-utime="1487060198" data-shorten="1" class="_5ptz"><span class="timestampContent">February 14 at 12:16am</span></abbr></a></span></span><span role="presentation" aria-hidden="true"> · </span><a data-hover="tooltip" data-tooltip-content="Public" class="uiStreamPrivacy inlineBlock fbStreamPrivacy fbPrivacyAudienceIndicator _5pcq" aria-label="Public" href="#" role="button"><img class="lock img" src="https://www.facebook.com/rsrc.php/v3/yB/r/-pz5JhcNQ9P.png" alt="" width="12" height="12" /></a></div></div></div></div></div></div></div></div><div class="userContent"></div><div class="_3x-2"><div data-ft="{"tn":"H"}"><div class="mtm"><div class="_5cq3" data-ft="{"tn":"E"}"><a class="_4-eo _2t9n" href="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1119561951485823/?type=3" rel="theater" ajaxify="/jayasaro.panyaprateep.org/photos/a.318290164946343.68815.318196051622421/1119561951485823/?type=3&size=1995%2C1259&fbid=1119561951485823&player_origin=story_view" data-render-location="permalink" style="width:476px;" data-testid="theater_link"><div class="uiScaledImageContainer _4-ep" style="width:476px;height:300px;" id="u_0_b"><img class="scaledImageFitHeight img" src="https://scontent-tpe1-1.xx.fbcdn.net/v/t1.0-0/s480x480/16711816_1119561951485823_8739945983235499404_n.jpg?oh=be280a3cf7fdb24cf084d8b554074daa&oe=593D7F92" style="left:0px;" alt="Image may contain: text" width="477" height="300" /></div></a></div></div></div></div><div></div></div></div><div><form rel="async" class="commentable_item collapsed_comments" method="post" data-ft="{"tn":"]"}" action="/ajax/ufi/modify.php" onsubmit="return window.Event && Event.__inlineSubmit && Event.__inlineSubmit(this,event)" id="u_0_e"><input type="hidden" name="lsd" value="AVq1bEX1" autocomplete="off" /><input type="hidden" autocomplete="off" name="ft_ent_identifier" value="1119561951485823" /><input type="hidden" autocomplete="off" name="data_only_response" value="1" /><div class="_sa_ _5vsi _192z"><div class="_37uu"></div></div><div class="uiUfi UFIContainer _5pc9 _5vsj _5v9k" id="u_0_d"></div></form></div></div></div></div></div>`