Skip to content

Commit

Permalink
Add Twitter filter to only get posts with media (only checks if exten…
Browse files Browse the repository at this point in the history
…ded_entities is present for now).
  • Loading branch information
stefansundin committed Aug 27, 2017
1 parent 7f7161d commit fd0fce6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app.rb
Expand Up @@ -103,6 +103,10 @@
@data = response.json
@username = @data[0]["user"]["screen_name"] rescue CGI.unescape(username)

if params[:with_media]
@data.select! { |t| t["extended_entities"] }
end

erb :twitter_feed
end

Expand Down
1 change: 1 addition & 0 deletions views/index.erb
Expand Up @@ -39,6 +39,7 @@
<li><a data-submit-type="include_rts=0&amp;exclude_replies=1">Exclude retweets and replies</a></li>
<li><a data-submit-type="include_rts=0">Exclude retweets</a></li>
<li><a data-submit-type="exclude_replies=1">Exclude replies</a></li>
<li><a data-submit-type="with_media=1">With media</a></li>
</ul>
<input class="btn btn-primary" type="submit" value="Get RSS Feed">
</span>
Expand Down

0 comments on commit fd0fce6

Please sign in to comment.