Short Code failure

I’ve been struggling for the past two weeks with a bit of short code provided by appfolio to display our available rentals on our site. I use a code module to insert the code into the page and it looks great until I publish and refresh the page. I’ve included the code but since I’m a new user I cannot provide screen shots that illustrate what is happening.

<script type='text/javascript' charset='utf-8'>
  document.write(unescape("%3Cscript src='" + (('https:' == document.location.protocol) ? 'https:' : 'http:') + "//myluckyhouse.appfolio.com/javascripts/listing.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type='text/javascript' charset='utf-8'>
  Appfolio.Listing({
    hostUrl: 'myluckyhouse.appfolio.com',
    propertyGroup: 'Unfurnished Rentals',
    themeColor: '#676767',
    height: '500px',
    width: '100%'
  });
</script>