<p>Accomplished this by setting the get request url, then passing it into tweets:</p>

<pre><code>{% set handle = entry.twitterHandle %}
{% set url = 'statuses/user_timeline.json?screen_name=' ~ handle ~ '&amp;count=3&amp;exclude_replies=true' %}
{% set tweets = craft.twitter.get(url) %}
</code></pre>

<p>Hope this helps someone else. Thx!</p>

CC BY-SA 3.0
2015-07-25T20:23:47.273Z
2015-07-25T20:23:47.273Z
Danielle LeComte
<p>I'd like to set the screen_name for a list of tweets using Dukt Twitter.</p>

<p>The screen_name is set in an entry as a plain text field.</p>

<pre><code>{% set entries = craft.entries.section('contactPage') %}
{% for entry in entries %}
{% if entry.twitterHandle|length %}
{% set tweets = craft.twitter.get("statuses/user_timeline.json?screen_name='~ entry.twitterHandle ~'&amp;count=3") %}
    {% if tweets %}
      &lt;h2&gt;Recent Tweets&lt;/h2&gt;
      &lt;div class="tweets"&gt;
    {% for tweet in tweets %}
        &lt;div class="tweet"&gt;
        &lt;div class="text"&gt;{{ tweet.text|autoLinkTweet }}&lt;/div&gt;
        &lt;div class="date"&gt;{{ tweet.created_at|date('M j Y') }}&lt;/div&gt;
    {% endfor %}
      &lt;/div&gt;
    {% else %}
        &lt;h2&gt;Recent Tweets&lt;/h2&gt;
        &lt;p&gt;No recent tweets at this time.&lt;/p&gt;
    {% endif %}
{% endif %}
{% endfor %}
</code></pre>

<p>Not possible? No matter what I try, I only get the feed for the oauth user. Any help would be greatly appreciated!</p>

<p>Thanks!</p>

CC BY-SA 3.0
2015-07-25T19:04:44.803Z
Have you looked at this?  https://dev.twitter.com/overview/api/users
Steve Adams
<plugin-dukttwitter>
Passing a screen_name to Dukt Twitter
# Passing a screen_name to Dukt Twitter

(Asked by: username_0 on 2015-07-25)

I'd like to set the screen_name for a list of tweets using Dukt Twitter.
The screen_name is set in an entry as a plain text field.
{% set entries = craft.entries.section('contactPage') %}
{% for entry in entries %}
{% if entry.twitterHandle|length %}
{% set tweets = craft.twitter.get("statuses/user_timeline.json?screen_name='~ entry.twitterHandle ~'&count=3") %}
    {% if tweets %}
      Recent Tweets
      
    {% for tweet in tweets %}
        
        {{ tweet.text|autoLinkTweet }}
        {{ tweet.created_at|date('M j Y') }}
    {% endfor %}
      
    {% else %}
        Recent Tweets
        No recent tweets at this time.
    {% endif %}
{% endif %}
{% endfor %}

Not possible? No matter what I try, I only get the feed for the oauth user. Any help would be greatly appreciated!
Thanks!

**Tags:** plugin-dukttwitter
> **Comments:**
> **username_1**: Have you looked at this?  https://dev.twitter.com/overview/api/users  

---

## 1 answers

### Answer by username_0 on 2015-07-25. Score: 6 | Accepted answer

Accomplished this by setting the get request url, then passing it into tweets:
{% set handle = entry.twitterHandle %}
{% set url = 'statuses/user_timeline.json?screen_name=' ~ handle ~ '&count=3&exclude_replies=true' %}
{% set tweets = craft.twitter.get(url) %}

Hope this helps someone else. Thx!


---

