# Dynamic page results based on user input

**URL:** <https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885>\
**Category:** Random\
**Created:** [March 22, 2020, 3:28am UTC](https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885 "2020-03-22T03:28:21Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![droidgoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/droidgoo/32/2209_2.png) [@droidgoo](https://forum.pinegrow.com/u/droidgoo)\
**Post date:** [April 4, 2020, 7:05pm UTC](https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885/21 "2020-04-04T19:05:28Z")

</div>

thanks for the feedback.

the share / download thing is definitely on my todo.

any tips on how to capture the dynamic rendering, other than taking a screen grab of it?

haven’t even started to research this part yet.

ur gonna say javascript again, aren’t you? 😉

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [April 4, 2020, 7:18pm UTC](https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885/22 "2020-04-04T19:18:11Z")

</div>

Not quite sure what you mean. Do you mean the grade and running total for tweeting?

---

<div class="post-metadata">

**Author:** ![droidgoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/droidgoo/32/2209_2.png) [@droidgoo](https://forum.pinegrow.com/u/droidgoo)\
**Post date:** [April 4, 2020, 7:35pm UTC](https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885/23 "2020-04-04T19:35:59Z")

</div>

yes, i mean the Your Grade image… if i right click in firefox it offers ‘screen grab’ in the menu

when i select it, i can single out the html element that makes up the image, as so

![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/f/f29acce7cece2c03f2d40c527d8123b7171c2067.png)

and i can paste it into other apps that understand how to turn that into an image (like twitter or here on PG).

paste doesn’t work in simple text boxes like the url addr bar or notepad.

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [April 4, 2020, 8:03pm UTC](https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885/24 "2020-04-04T20:03:50Z")

</div>

Well, you can send tweets with PHP using the twitter OAuth. I haven’t done it before, but I think you would have to grab your DOM element (probably using JavaScript 😉 ) and then send it as a post to your server. The script on the server side would then have to negotiate with twitter to send the DOM element out as a tweet. My mind gets cramps thinking about how to set the rest of the tweet up on the client side if they want to add anything. Maybe mock up the twitter interface in a HTML modal, then parse it out and send it to the server? I’m impressed with how far you come so far with this. As they say in the iconic movie ‘The Waterboy’, “You can do it!”

---

<div class="post-metadata">

**Author:** ![droidgoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/droidgoo/32/2209_2.png) [@droidgoo](https://forum.pinegrow.com/u/droidgoo)\
**Post date:** [April 4, 2020, 8:16pm UTC](https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885/25 "2020-04-04T20:16:36Z")

</div>

thanks, i may just cheat and throw in a modal with instructions on how to take a screen grab…

---

<div class="post-metadata">

**Author:** ![droidgoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/droidgoo/32/2209_2.png) [@droidgoo](https://forum.pinegrow.com/u/droidgoo)\
**Post date:** [May 18, 2020, 11:12pm UTC](https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885/26 "2020-05-18T23:12:58Z")

</div>

Ok, so that was a long journey.

But i’ve finally managed to include the “share your score” via twitter function, and i’m pretty pleased with how it came out.

Diving into the details of PRG architecture and all the flame wars about when it applies when it doesn’t apply… made it really hard to figure out WHAT IT IS they were talking about, and HOW to actually do it.

this guy explained like i needed it explained.  
PHP - Post / Redirect - Part 2 [https://youtu.be/bIkqNHyj25w](https://youtu.be/bIkqNHyj25w) via @YouTube

I also found a linux utility (open source) called **[wkhtmltoimage](https://wkhtmltopdf.org/)** that will render a dynamic html file (with php embedded) at the server end and save it as a .jpg… that was the other half of the battle. The render engine is not fully up to spec but it does a decent job on simple markup and style. It’s supposed to support .css style sheets, but i just cheated and put them inline.

then the 3rd half of battle was coordinating all the files and handoffs i needed to make in order to get those results into a tweet. twitter cards are used to display the dynamic output in the twitter timeline (i was actually surprised that worked, twitter has been flaky)

feel free to take it for a test drive.

> **[Freedometer – What grade do you give America?](https://putpeopleoverprofit.org/freedometer.html)**
>
> Take the test and post your letter grade for America on social media with a link to the test for others to take.

[Previous page](https://forum.pinegrow.com/t/dynamic-page-results-based-on-user-input/3885.md?page=1)
