Shinkai005
2023/02/21阅读:15主题:极简黑
【WebScience】第一节lab+Twitter开发者注册
【WebScience】第一节lab+Twitter开发者注册.md
简介
主要是学WWW万维网的, 特征特点对社会和技术的影响.
万维网改变了我们交互方式. 所以我们要探索一下这些对个人和社会的好处~
学习目标:
分析和实现web应用的技术
描述在网络上开发广告模式所需要的技术
分析社交网络所需要的技术
能够理解和合理化在线社区的隐私威胁和缓解策略
描述深度学习模型及其在社会系统中的应用
描述进行大规模数据分析的方法,分析用户在网络上的行为,预测用户人口统计和购买行为
描述情感和情感提取技术,并运用它们
先看录播
再看ppt
录播
-
H4077 M 5078和 MSC 5107的区别 -
学术目的不同 考试不同, 但是讲座和实验一样 -
考试的时候会出现不同的入口~ 记得进入正确的 -
大多数东西都在moodle, teams偶尔会有,但是moodle都会重新发~(倾向于moodle的老师) -
考试的东西还没有决定~ 但是说了在线~一月底可以给出方案 -
期末考试占比80% -
如果是开卷考试一般是 给3道题, 回答两道.如果回答三道会记录前两道分数. -
submission的ddl可以跟老师说.. -
老师提前发的视频 视频是提前看的

-
后文大致内容就是~ 不会python学python, 环境搞不定自己搞定, 自己不行求助导师助手~ 规定时间搞不定就不管你了~(所以web science的优先级要提高一些) -
(这个老师直接提到了这点很不错~)这学期课程压力很大, 并且学生也很多,我尽力但一定无法全部照顾到, 如果无法提前或者按时catch up. 你就需要在这周内跟上~ -
PPT是只有知识点(bullet points)~ 没有详细描述, 想听详细描述就得来上课~
第一步
-
创建developer account 开发者账号; 为了获取数据和有权限处理数据 -
根据teams的pdf 流程创建账号~(如果遇到问题先看一下 teams的问答)

-
然后按照内容进行, 偶尔会遇到additional question的情况. 可以直接发teams问导师~ (问题是机器人处理的~ )

这个验证真的.......一言难尽
twitter打开发现切屏 信息发布时间会变化~事件监听应该用的下面的~
document.addEventListener("visibilitychange", function() { console.log( document.visibilityState ); //页面显示时document.visibilityState值为visible,隐藏显示时document.visibilityState值为hidden, //或者 document.title = document.hidden ? '离开这个页面了' : '又回到这个页面了'; //这个是判断document.hidden,页面的隐藏状态 });
搞定后打开teams里那个py文件更新数据运行~

PPT-Introducation 24页
-
不同模块的区别 -
课程安排 -
lecture和lab -
recording video(提前看)
-
-
moodle和teams的使用 -
这个老师比较靠谱(目前是两个上面有相同内容~有邮件提醒)
-
-
关于Labs -
主要是为了完成lecture的内容 -
lab sheets会有一堆问题(不提供答案) -
问老师或者学生一起解决 -
不完成就没有答案~
-
-
课程占比80(final)和20(course work) -
couse work (20%) -
第二周发布 -
ddl是2月27 第八周 十点am -
code和report两个不同文件
-
-
学生应该如何做? -
提前看视频 -
了解讨论重点 -
有问题提前问
-
-
老师建议 -
课程一共10周比较长 -
合理安排 -
尽力追赶 -
讨论和提出疑问很重要
-
后面就是关于twitter开发者账号了
Twitter开发者账号注册
https://developer.twitter.com/en/docs/tutorials/step-by-step-guide-to-making-your-first-request-to-the-twitter-api-v2这里是流程
https://developer.twitter.com/en/portal/petition/essential/basic-info这是注册开发者账号地址
然后结合老师的ppt三者一起~
(ok你们不用看了 看我下文就行了)
注册开发者账号地址打开填写如下


我这里提示了--必须要有验证过的手机号码
研究了一下怎么添加手机号~ https://twitter.com/settings/phone直接这个网址就行了. (还可以手机,还可以gui点点点,这个方便点)
然后就可以发送了~
会受到一个验证码,填写进入即可

之后进入这个页面

取个名字下一步

按照上面的流程, 接下来要进行第一次调用~

注意最后的分号

直接把这个代码复制到终端, 把$以及后面内容改成token~ 注意分号
正确运行即可
接下来进入python编辑器~ 随便开一个项目

我是把token赋值上去了~ 可以运行了
用mac配置环境变量无法正确运行 解释放这里了https://blog.csdn.net/tao_627/article/details/104856365

postman

到这里只是说明V1的接口ok了, 接下来升级v2
阅读升迁文档过程中遇到glitch这个单词, 意思是小故障

升级在这个位置

开始申请
几个问题答案我粘贴在这里
-
* The core use case, intent, or business purpose for your use of the Twitter APIs.
The request is for purely academic learning purposes; hence I am requesting a developer account.
School of Computing Science, University of Glasgow, UK is offering a course on Web Science to the
3rd and 4th year undergraduate students (COMPSCI4077 - Web Science) during Semester 2 (January
to March 2023). The coursework for this course (weightage 20%) is for developing Twitter data
analytics techniques using Twitter API. Students need to use Streaming API and RESTful API to
collect data from UK and conduct specialized analytics.
-
* If you intend to analyze Tweets, Twitter users, or their content, share details about the analyses you plan to conduct, and the methods or techniques.
• I will analyse Tweets and users only to reply to the questions of the assessment, that are:
• Group the tweets based on similarities
• Count the amount of data collected and show a histogram of a 10-minute period
• Count redundant data and show a histogram of a 10-minute period
• Count the retweets and quotes and show a histogram of a 10-minute period
• Count the multimedia content types and show a histogram of a 10-minute period
• We will look into the overall sentiments expressed on the grouped tweets.
• We are going to use Tweepy and Numpy in Python. We will
• collect data with Streaming API
• group that data to gain insights
• based on the insights develop a more accurate REST API
• then do data analysis on the collected data
-
* If your use involves Tweeting, Retweeting, or liking content, share how you’ll interact with Twitter accounts, or their content. • I will not be tweeting or retweeting or liking content. I will collect data just to answer questions described above.
• I will not be tweeting or retweeting or liking content. I will collect data just to answer questions described above.
-
If you’ll display Twitter content off of Twitter, explain how, and where, Tweets and Twitter content will be displayed with your product or service, including whether Tweets and Twitter content will be displayed at row level, or aggregated.
I will not display Twitter content. I will only display the 4 histograms obtained from the data collected through my analysis, that are:
• amount of data collected in 10 minutes
• amount of redundant data collected in 10 minutes
• amount of retweets or quotes in 10 minutes
• amount of multimedia content in 10 minutes
• These 4 histograms will only be displayed in the report I submit, which will be private and will not be made public.
按顺序cv就好
最后一个选否
提交后会说''收到48小时内回复''的邮件
ok 我收到了一封邮件,让重新回复, 内容是和上面一模一样的. 我直接复制粘贴了.
这个lab就先放到这里了, 写上课笔记去.
- END -作者介绍
Shinkai005
公众号:深海笔记Shinkai