How can I let users view their own timeline on my webpage?


#1

I need to let my visitors be able to login from this type of page https://rickym.com/p/index2.htm
so they can see their own time-line and tweet or reply if needed.

We do not want our servers to be involved in anyting else, Php, database, tracking or keeping any additional client info. The script to do this must be contained within the html page.

Any help or ideas?

Much thanks.

Richard


#2

Twitter will not pass your site the current user without the user granting permission to your Twitter application over OAuth.

You can construct a user timeline based on a user-inputted screen_name value. Construct a text input asking for a screen_name and construct a user timeline with the result by calling twttr.widgets.createTimeline.
https://dev.twitter.com/web/javascript/creating-widgets


#3

I’ll expand my post to clarify it better. I do want to stay away from OAuth and keep this function contained in the html page only.

You’ve likedly concluded that I am not a skilled programmer or code writer.
-:slight_smile:

Richard

*** WHATS NEEDED *******************************

let my visitors be able to insert from this type of page https://rickym.com/p/index2.htm
so they can see their own TWITTER time-line. Then be able to switch between the embedded twitter time-line and their own time-line

We do not want our servers to be involved in anything to do this, no Php, database, tracking or keeping any additional client info.

The script to do this must be contained within the html page.


For users.

logon to twitter, go to settings, then Widgets, hit Create then put your @Username in, unclick both options (this saves you data costs) keep height at 600px, choose theme and link-color or best just leave them as is for now. Hit create widget. Copy the code

        <a class="twitter-timeline"  href="https://twitter.com/twitter" data-widget-id="513415473593999360">Tweets by @twitter</a>
        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Save your changes.

Now you have the 3 things you need to set-up on rickym:

the number from
data-widget-id=“513415473593999360”

your twitter Username
@yourusername

yourusername (without the @)

Use the id-number, @yourusername and yourusername to set-up your own twitter time-line on any rickym.com/??. It will save a cookie on your device for your twitter-timeline.

Once done you can go to any rickym.com/?? and switch between your own twitter-timeline and that persons twitter-timeline.

If the cookie gets deleted you have to repeat this or simply keep your data-widget id number handy.


#4

You can use the widget ID you set with preferences for your site and just specify the screenname entered by the user.

Call the twttr.widgets.createTimeline JavaScript function after the Twitter username is submitted or build HTML markup for a.twitter-timeline, swapping in the screen_name values.


#5