首页 \ 问答 \ Twitter API高级搜索推文来自用户(Twitter API advanced search tweets from user)

Twitter API高级搜索推文来自用户(Twitter API advanced search tweets from user)

Twitter API是否有搜索工具可以从Twitter历史用户时间线中查找特定字符串,而无需加载所有3200条推文并使用针干草堆方法进行搜索?

我从文档中读到,搜索twitter API仅返回7天,这还不够。

Twitter在其网站上的高级搜索范围更广泛:

通过在Twitter中搜索'clinton from:realdonaldtrump',它显示了几年来推文中的用户realdonaldtrump中包含字符串'clinton'的推文。

https://twitter.com/search?q=clinton%20from%3Arealdonaldtrump&src=typd&lang=en

Twitter API没有类似的功能吗?


Does the Twitter API have a search tool to find specific strings from Twitter historical User timelines without having to load all 3200 tweets and search for it with the needle haystack method?

I read from the documentation that the search twitter API only goes back 7 days which isn't enough.

Twitter's advanced search on its website is much more extensive:

By searching 'clinton from:realdonaldtrump' in twitter, it shows the tweets for several years that have the string 'clinton' in it from the user realdonaldtrump.

https://twitter.com/search?q=clinton%20from%3Arealdonaldtrump&src=typd&lang=en

Does the Twitter API not have a similar function?


原文:https://stackoverflow.com/questions/36063154
更新时间:2023-01-17 14:01

最满意答案

底线; 不要阻塞主线程,因此不要阻止主事件循环。

现在,你可以产生一个线程。 但这实际上并不是在Mac OS X上编写并发程序的正确方法。

相反,使用NSOperation和NSOperationQueue。 它专门用于支持您的并发编程需求,它可以很好地扩展,并且NSOperationQueue紧密集成到系统中,以便它可以更有效地控制基于可用系统资源(核心数,来自其他应用程序的CPU负载等)的并发性。 任何直接使用线程。

另请参阅“ 线程编程指南”


Bottom line; don't block the main thread and, thus, don't block the main event loop.

Now, you could spawn a thread. But that isn't actually the correct way write concurrent programs on Mac OS X.

Instead, use NSOperation and NSOperationQueue. It is specifically designed to support your concurrent programming needs, it scales well, and NSOperationQueue is tightly integrated into the system such that it will control concurrency based on system resources available (# of cores, CPU load from other applications, etc) more efficiently than any direct use of threads.

See also the Threaded Programming Guide.

相关问答

更多
  • 应用程序的委托有一个可选的方法,它将自动执行此操作。 所有你需要做的是将其添加到实现中。 你不需要创建一个插座或任何东西。 - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { return YES; } There is an optional method for the application's delegate which will do this automat ...
  • 只需使用NSOpenPanel并将允许的文件类型设置为public.image UTI: [panel setAllowedFileTypes:[NSArray arrayWithObject:@"public.image"]]; 这会自动将“ 媒体”部分和“ 照片”项添加到打开面板中的侧边栏,以便用户从其iPhoto图库中进行选择。 或者,您可以使用卡累利阿的开源iMedia浏览器 。 Just use NSOpenPanel and set the allowed file types to the ...
  • 将其添加到info.plist中 LSUIElement 1 现在应用程序不会出现在扩展坞中,菜单栏将不会显示。 所有菜单栏应用程序(菜单)都不需要用户界面 Add this in info.plist LSUIElement 1 Now the application doesn't appear in the dock and the menu bar won't be displayed ...
  • 这就是我做到的。 我创建了一个新的AsyncTask代码是: public class ApplyWallpaper extends AsyncTask { private Context context; private Activity activity; private MaterialDialog dialog; private Bitmap resource; public ApplyWallpaper(Con ...
  • 你可以在这里使用NSTask ( API参考 )。 NSTask需要(其中包括)指向脚本的launchPath 。 它也可以接受一系列arguments ,当你准备启动你的任务时,你可以调用launch() 。 所以......沿着以下几点: var task = NSTask() task.launchPath = "path to your script" task.launch() 你想了解更多吗 你可以看看: 这是一个例子 这个答案 (在Objective C中) 本文来自Ray Wenderli ...
  • 由XCode生成的“委托”包含NSPersistentStoreCoordinator,NSManagedObjectModel和NSManagedObjectContext的实例 - 请详细说明? 这是核心数据的东西。 该委托被声明为“@interface tests_AppDelegate:NSObject {”。 为什么协议缺失? 我在网上看到了它的例子。 可能是一个疏忽。 AppKit并不总是有一个正式的NSApplicationDelegate协议。 Apple可能从未更新过模板。 你可能会提交一 ...
  • 底线; 不要阻塞主线程,因此不要阻止主事件循环。 现在,你可以产生一个线程。 但这实际上并不是在Mac OS X上编写并发程序的正确方法。 相反,使用NSOperation和NSOperationQueue。 它专门用于支持您的并发编程需求,它可以很好地扩展,并且NSOperationQueue紧密集成到系统中,以便它可以更有效地控制基于可用系统资源(核心数,来自其他应用程序的CPU负载等)的并发性。 任何直接使用线程。 另请参阅“ 线程编程指南” 。 Bottom line; don't block th ...
  • 我假设您已经在InterfaceBuilder中正确连接了NSDatePicker,因此它连接到DatePicker。 如果是这样,您应该能够分配如下: NSDate * unformattedDate = [ datePicker dateValue ]; 然后使用unformattedDate作为格式化程序的输入,像以前一样进行格式化。 I'm assuming you have the NSDatePicker correctly hooked up in InterfaceBuilder so i ...
  • 这是必须以编程方式完成的事情(据我所知)。 您可以在界面构建器中创建滑块并使其垂直并为其提供插座以及所有这些。 您也可以在Interface Builder中创建NSMenuItem和NSMenu ,但是您必须通过代码在菜单项中嵌入滑块。 IB中无法做到这一点。 但是,从那里它非常简单: NSSlider * slider = ...; //IBOutlet to your slider NSMenuItem * item = ...; //IBOutlet to your menuitem [item s ...
  • 嗯,这对我有用: # -*- coding: utf-8 -*- import wx app = wx.App(redirect=False) top = wx.Frame(None) top.Maximize(False) # Set to maximize the application sizer = wx.GridBagSizer() def testFunction(event): import time for i in range(2): print ('wi ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)