{"id":774,"date":"2023-04-26T02:54:36","date_gmt":"2023-04-26T05:54:36","guid":{"rendered":"https:\/\/freeshell.de\/~felipe\/blog\/?p=774"},"modified":"2024-06-09T15:44:28","modified_gmt":"2024-06-09T18:44:28","slug":"tweepy-changes-on-python","status":"publish","type":"post","link":"https:\/\/freeshell.de\/~felipe\/blog\/04\/2023\/python\/tweepy-changes-on-python\/","title":{"rendered":"Tweepy changes on Python"},"content":{"rendered":"\n<p>I was trying to use a parameter with the module tweepy, and I realised that the new version 4.0, has a change, well is very simple but it could create a whole new checking in your code, so it&#8217;s better to know already.<\/p>\n\n\n\n<p>The change is, for ex. in the parameter &#8216;search&#8217;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>api = tweepy.API(auth)\n\nfor tweets in api.search(q=\"iphone\", lang=\"en\"):\n    print(tweet.text)\n<\/code><\/pre>\n\n\n\n<p>Now, <a href=\"https:\/\/github.com\/tweepy\/tweepy\/releases\/tag\/v4.0.0\">Tweepy v4.0.0<\/a>\u00a0was released and renamed\u00a0<code>API.search<\/code>\u00a0to\u00a0<a href=\"https:\/\/tweepy.readthedocs.io\/en\/v4.0.0\/api.html#tweepy.API.search_tweets\"><code>API.search_tweets<\/code><\/a>.<\/p>\n\n\n\n<p>I would recommend simply renaming your method call, but you could also downgrade to Tweepy v3.10.0.<\/p>\n\n\n\n<p>It&#8217;s not nice, in my opinion to be changing all the time little parameters, but now it would be something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for tweets in api.search_tweets(q=\"iphone\", lang=\"en\"):\n    print(tweet.text)<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was trying to use a parameter with the module tweepy, and I realised that the new version 4.0, has a change, well is very simple but it could create a whole new checking in your code, so it&#8217;s better to know already. The change is, for ex. in the parameter &#8216;search&#8217;: Now, Tweepy v4.0.0\u00a0was [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[83],"tags":[81,80,82],"class_list":["post-774","post","type-post","status-publish","format-standard","hentry","category-python","tag-programming","tag-python","tag-tweetpy"],"_links":{"self":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/comments?post=774"}],"version-history":[{"count":1,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/774\/revisions"}],"predecessor-version":[{"id":775,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/774\/revisions\/775"}],"wp:attachment":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/media?parent=774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/categories?post=774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/tags?post=774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}