Skip to content

Commit

Permalink
CP-63 Fixed Facebook post load
Browse files Browse the repository at this point in the history
  • Loading branch information
hlushko committed Oct 12, 2018
1 parent 1153435 commit 7c6e231
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chain-post/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ <h5 class="modal-title" id="facebookTitle">Facebook post load</h5>
<script src="js/lib/jquery.min.js" integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" crossorigin="anonymous"></script>
<script src="js/lib/bootstrap.bundle.min.js" integrity="sha384-pjaaA8dDz/5BgdFUPX6M/9SUZv4d12SUPF0axWc+VRZkx5xU3daN+lYb49+Ax+Tl" crossorigin="anonymous"></script>

<script src="js/main.min.js?t=1539295753"></script>
<script src="js/main.min.js?t=1539295757"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions chain-post/js/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,11 @@ function setHandlerLoadFacebook() {
, postImages = ``
;

let textTitles = content.match(/"title":{"text":"(.+?)"/g)
let textTitles = content.match(/"title":{"text":"(.+?)","/g)
, titles = []
;
for (let i in textTitles) {
let titleObj = JSON.parse(sprintf(`{%s}}`, textTitles[i]));
let titleObj = JSON.parse(sprintf(`{%s}}`, textTitles[i].slice(0, -2)));

titles.push(titleObj.title.text);
}
Expand All @@ -396,7 +396,7 @@ function setHandlerLoadFacebook() {
postImages = JSON.stringify(imagesUrls);
}

let textBody = content.match(/"message":{"text":"(.+?)"/);
let textBody = content.match(/"message":{"text":"(.+?)","/);
if (textBody && textBody.length > 1) {
let textObj = JSON.parse(sprintf(`{"body":"%s"}`, textBody[1]));

Expand Down
2 changes: 1 addition & 1 deletion chain-post/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit 7c6e231

Please sign in to comment.